From: Brion Vibber Date: Sun, 2 Aug 2009 07:36:47 +0000 (+0000) Subject: Suppress 'Expect: 100-continue' header on Http::post, as some servers will reject... X-Git-Tag: 1.31.0-rc.0~40584 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=40038bfe4acc4b28f24d2e0513b9205df87c5166;p=lhc%2Fweb%2Fwiklou.git Suppress 'Expect: 100-continue' header on Http::post, as some servers will reject it with a 417 and Curl won't auto retry. Curl seems to like to insert this HTTP 1.1 request header sometimes, but not always, when you add post data. --- diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php index 338f1e0676..d4c2d0325a 100644 --- a/includes/HttpFunctions.php +++ b/includes/HttpFunctions.php @@ -333,6 +333,10 @@ class HttpRequest { } elseif ( $this->method == 'POST' ) { curl_setopt( $c, CURLOPT_POST, true ); curl_setopt( $c, CURLOPT_POSTFIELDS, $this->postData ); + // Suppress 'Expect: 100-continue' header, as some servers + // will reject it with a 417 and Curl won't auto retry + // with HTTP 1.0 fallback + curl_setopt( $c, CURLOPT_HTTPHEADER, array( 'Expect:' ) ); } else { curl_setopt( $c, CURLOPT_CUSTOMREQUEST, $this->method ); }