dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
523ce0a
)
Suppress 'Expect: 100-continue' header on Http::post, as some servers will reject...
author
Brion Vibber
<brion@users.mediawiki.org>
Sun, 2 Aug 2009 07:36:47 +0000
(07:36 +0000)
committer
Brion Vibber
<brion@users.mediawiki.org>
Sun, 2 Aug 2009 07:36:47 +0000
(07:36 +0000)
Curl seems to like to insert this HTTP 1.1 request header sometimes, but not always, when you add post data.
includes/HttpFunctions.php
patch
|
blob
|
history
diff --git
a/includes/HttpFunctions.php
b/includes/HttpFunctions.php
index
338f1e0
..
d4c2d03
100644
(file)
--- 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 );
}