From ee71b2eb882b8f082717ba01fdfec3abac47faff Mon Sep 17 00:00:00 2001 From: dd32 Date: Wed, 19 Oct 2011 04:48:00 +0000 Subject: [PATCH] Respect the Content-Type header developers pass to WP_HTTP. Fixes #18982 git-svn-id: http://svn.automattic.com/wordpress/trunk@19000 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-http.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-includes/class-http.php b/wp-includes/class-http.php index 8940fdd16..e2bfac19c 100644 --- a/wp-includes/class-http.php +++ b/wp-includes/class-http.php @@ -180,7 +180,8 @@ class WP_Http { } else { if ( is_array( $r['body'] ) || is_object( $r['body'] ) ) { $r['body'] = http_build_query( $r['body'], null, '&' ); - $r['headers']['Content-Type'] = 'application/x-www-form-urlencoded; charset=' . get_option( 'blog_charset' ); + if ( ! isset( $r['headers']['Content-Type'] ) ) + $r['headers']['Content-Type'] = 'application/x-www-form-urlencoded; charset=' . get_option( 'blog_charset' ); $r['headers']['Content-Length'] = strlen( $r['body'] ); }