WP_HTTP: Allow developers to specify a Accept-Encoding header. Fixes #20142
git-svn-id: http://core.svn.wordpress.org/trunk@23600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4b4b35ae3b
commit
78e4b5afde
|
@ -166,7 +166,7 @@ class WP_Http {
|
||||||
// Construct Cookie: header if any cookies are set
|
// Construct Cookie: header if any cookies are set
|
||||||
WP_Http::buildCookieHeader( $r );
|
WP_Http::buildCookieHeader( $r );
|
||||||
|
|
||||||
if ( WP_Http_Encoding::is_available() )
|
if ( ! isset( $r['headers']['Accept-Encoding'] ) && WP_Http_Encoding::is_available() )
|
||||||
$r['headers']['Accept-Encoding'] = WP_Http_Encoding::accept_encoding();
|
$r['headers']['Accept-Encoding'] = WP_Http_Encoding::accept_encoding();
|
||||||
|
|
||||||
if ( ( ! is_null( $r['body'] ) && '' != $r['body'] ) || 'POST' == $r['method'] || 'PUT' == $r['method'] ) {
|
if ( ( ! is_null( $r['body'] ) && '' != $r['body'] ) || 'POST' == $r['method'] || 'PUT' == $r['method'] ) {
|
||||||
|
|
Loading…
Reference in New Issue