Respect the Content-Type header developers pass to WP_HTTP. Fixes #18982

git-svn-id: https://develop.svn.wordpress.org/trunk@19000 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2011-10-19 04:48:00 +00:00
parent cc9e6ecb65
commit 81197a2dd5
1 changed files with 2 additions and 1 deletions

View File

@ -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'] );
}