From 1aecc6c9576288808af2ec25776f9b52f5170f06 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Wed, 28 Aug 2013 04:59:09 +0000 Subject: [PATCH] WP_HTTP: When requesting a document with HTTP/1.1 include the 'Connection: Close' header (unless a Connection header is already specified) to prevent the connection being held open and hanging the request process. See #23463 Built from https://develop.svn.wordpress.org/trunk@25150 git-svn-id: http://core.svn.wordpress.org/trunk@25129 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-http.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wp-includes/class-http.php b/wp-includes/class-http.php index 0c57ccc906..b1bfef3e1f 100644 --- a/wp-includes/class-http.php +++ b/wp-includes/class-http.php @@ -172,6 +172,10 @@ class WP_Http { unset( $r['headers']['user-agent'] ); } + if ( '1.1' == $r['httpversion'] && !isset( $r['headers']['connection'] ) ) { + $r['headers']['connection'] = 'close'; + } + // Construct Cookie: header if any cookies are set WP_Http::buildCookieHeader( $r );