diff --git a/wp-includes/class-http.php b/wp-includes/class-http.php index d52bb118fe..3aac5bae73 100644 --- a/wp-includes/class-http.php +++ b/wp-includes/class-http.php @@ -861,6 +861,11 @@ class WP_Http_Streams { } } + // Always pass a Path, defaulting to the root in cases such as http://example.com + if ( ! isset( $arrURL['path'] ) ) { + $arrURL['path'] = '/'; + } + if ( isset( $r['headers']['Host'] ) || isset( $r['headers']['host'] ) ) { if ( isset( $r['headers']['Host'] ) ) $arrURL['host'] = $r['headers']['Host']; @@ -965,9 +970,6 @@ class WP_Http_Streams { else $requestPath = $arrURL['path'] . ( isset($arrURL['query']) ? '?' . $arrURL['query'] : '' ); - if ( empty($requestPath) ) - $requestPath .= '/'; - $strHeaders = strtoupper($r['method']) . ' ' . $requestPath . ' HTTP/' . $r['httpversion'] . "\r\n"; $include_port_in_host_header = (