diff options
author | Friendika <info@friendika.com> | 2011-02-07 23:20:38 -0800 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-02-07 23:20:38 -0800 |
commit | d37ee1b399c7f03e301b9cb70ed32b95ebaa65b5 (patch) | |
tree | ec3faf9a6c08b6803f33062ed2f538061d15aa56 /boot.php | |
parent | 9f5d3000c74253a1284abda16006d74df84073fe (diff) | |
download | volse-hubzilla-d37ee1b399c7f03e301b9cb70ed32b95ebaa65b5.tar.gz volse-hubzilla-d37ee1b399c7f03e301b9cb70ed32b95ebaa65b5.tar.bz2 volse-hubzilla-d37ee1b399c7f03e301b9cb70ed32b95ebaa65b5.zip |
at least one server is giving CURL a second set of headers (and it isn't a 100 continue which we've already accounted for)
Diffstat (limited to 'boot.php')
-rw-r--r-- | boot.php | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -626,7 +626,16 @@ function fetch_url($url,$binary = false, &$redirects = 0) { } } $a->set_curl_code($http_code); + $body = substr($s,strlen($header)+4); + + /* one more try to make sure there are no more headers */ + + if(strpos($body,'HTTP/') === 0) { + $header = substr($body,0,strpos($body,"\r\n\r\n")); + $body = substr($body,strlen($header)+4); + } + $a->set_curl_headers($header); curl_close($ch); @@ -690,6 +699,14 @@ function post_url($url,$params, $headers = null, &$redirects = 0) { } $a->set_curl_code($http_code); $body = substr($s,strlen($header)+4); + + /* one more try to make sure there are no more headers */ + + if(strpos($body,'HTTP/') === 0) { + $header = substr($body,0,strpos($body,"\r\n\r\n")); + $body = substr($body,strlen($header)+4); + } + $a->set_curl_headers($header); curl_close($ch); |