mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
When making a HTTP request to a non-standard port, include the port in the Host header for the Streams HTTP transport. This bring parity to the cURL transport and respects the HTTP RFC.
Props kamelkev for the initial patch; Fixes #28982 git-svn-id: https://develop.svn.wordpress.org/trunk@29852 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -970,10 +970,17 @@ class WP_Http_Streams {
|
||||
|
||||
$strHeaders = strtoupper($r['method']) . ' ' . $requestPath . ' HTTP/' . $r['httpversion'] . "\r\n";
|
||||
|
||||
if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) )
|
||||
$include_port_in_host_header = (
|
||||
( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) ||
|
||||
( 'http' == $arrURL['scheme'] && 80 != $arrURL['port'] ) ||
|
||||
( 'https' == $arrURL['scheme'] && 443 != $arrURL['port'] )
|
||||
);
|
||||
|
||||
if ( $include_port_in_host_header ) {
|
||||
$strHeaders .= 'Host: ' . $arrURL['host'] . ':' . $arrURL['port'] . "\r\n";
|
||||
else
|
||||
} else {
|
||||
$strHeaders .= 'Host: ' . $arrURL['host'] . "\r\n";
|
||||
}
|
||||
|
||||
if ( isset($r['user-agent']) )
|
||||
$strHeaders .= 'User-agent: ' . $r['user-agent'] . "\r\n";
|
||||
|
||||
Reference in New Issue
Block a user