From 7569a6600eefc08a9fb5354e8743bb2fbb5ec0a4 Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Wed, 28 Mar 2012 14:53:41 -0400 Subject: [PATCH] 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 --- includes/HttpFunctions.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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(); -- 2.20.1