From: Mark A. Hershberger Date: Wed, 28 Mar 2012 18:53:41 +0000 (-0400) Subject: Avoid setting multiple Content-Type headers. X-Git-Tag: 1.31.0-rc.0~24103^2 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=7569a6600eefc08a9fb5354e8743bb2fbb5ec0a4;p=lhc%2Fweb%2Fwiklou.git Avoid setting multiple Content-Type headers. Necessary for JSON-RPC where Content-Type has to be set to application/json on POST. Change-Id: I0d974c98d914a22d0150a198a9f630206bb01d64 --- diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php index 8dd652581f..a1d2e59e59 100644 --- a/includes/HttpFunctions.php +++ b/includes/HttpFunctions.php @@ -800,7 +800,9 @@ class PhpHttpRequest extends MWHttpRequest { if ( $this->method == 'POST' ) { // Required for HTTP 1.0 POSTs $this->reqHeaders['Content-Length'] = strlen( $this->postData ); - $this->reqHeaders['Content-type'] = "application/x-www-form-urlencoded"; + if( !isset( $this->reqHeaders['Content-Type'] ) ) { + $this->reqHeaders['Content-Type'] = "application/x-www-form-urlencoded"; + } } $options = array();