default curl to http/1.1

This commit is contained in:
zotlabs 2018-12-16 14:38:58 -08:00
parent fc78206049
commit 04a45a407e

View File

@ -120,6 +120,14 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) {
@curl_setopt($ch, CURLOPT_USERPWD, $opts['http_auth']); @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')) if(x($opts,'cookiejar'))
@curl_setopt($ch, CURLOPT_COOKIEJAR, $opts['cookiejar']); @curl_setopt($ch, CURLOPT_COOKIEJAR, $opts['cookiejar']);
if(x($opts,'cookiefile')) if(x($opts,'cookiefile'))
@ -290,6 +298,13 @@ function z_post_url($url, $params, $redirects = 0, $opts = array()) {
@curl_setopt($ch, CURLOPT_USERPWD, $opts['http_auth']); @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')) if(x($opts,'cookiejar'))
@curl_setopt($ch, CURLOPT_COOKIEJAR, $opts['cookiejar']); @curl_setopt($ch, CURLOPT_COOKIEJAR, $opts['cookiejar']);
if(x($opts,'cookiefile')) if(x($opts,'cookiefile'))