default curl to http/1.1

(cherry picked from commit 04a45a407e)
This commit is contained in:
zotlabs 2018-12-16 22:38:58 +00:00 committed by Mario
parent aabc6c2825
commit 06c71eec65

View File

@ -116,6 +116,14 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) {
@curl_setopt($ch, CURLOPT_USERPWD, $opts['http_auth']);
}
if(array_key_exists('http_version',$opts)) {
@curl_setopt($ch,CURLOPT_HTTP_VERSION,$opts['http_version']);
}
else {
@curl_setopt($ch,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_1);
}
if(x($opts,'cookiejar'))
@curl_setopt($ch, CURLOPT_COOKIEJAR, $opts['cookiejar']);
if(x($opts,'cookiefile'))
@ -286,6 +294,13 @@ function z_post_url($url, $params, $redirects = 0, $opts = array()) {
@curl_setopt($ch, CURLOPT_USERPWD, $opts['http_auth']);
}
if(array_key_exists('http_version',$opts)) {
@curl_setopt($ch,CURLOPT_HTTP_VERSION,$opts['http_version']);
}
else {
@curl_setopt($ch,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_1);
}
if(x($opts,'cookiejar'))
@curl_setopt($ch, CURLOPT_COOKIEJAR, $opts['cookiejar']);
if(x($opts,'cookiefile'))