diff options
author | zotlabs <mike@macgirvin.com> | 2018-12-16 22:38:58 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2018-12-17 12:17:44 +0100 |
commit | 06c71eec659e4cce89a7623291e6e855fd0c0ce4 (patch) | |
tree | 7951e0815ac18f8abed13b62ff708bf4d8cc050a | |
parent | aabc6c282560a67c7232bc7545a93e71831c04e8 (diff) | |
download | volse-hubzilla-06c71eec659e4cce89a7623291e6e855fd0c0ce4.tar.gz volse-hubzilla-06c71eec659e4cce89a7623291e6e855fd0c0ce4.tar.bz2 volse-hubzilla-06c71eec659e4cce89a7623291e6e855fd0c0ce4.zip |
default curl to http/1.1
(cherry picked from commit 04a45a407ead8e7afcdd3423b773074207e885df)
-rw-r--r-- | include/network.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/network.php b/include/network.php index d37da05f7..a9a7cd03e 100644 --- a/include/network.php +++ b/include/network.php @@ -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')) |