MultiHttpClient: Don't relay the end-of-headers line
[lhc/web/wiklou.git] / includes / libs / MultiHttpClient.php
index 6ce8f45..536177e 100644 (file)
@@ -384,7 +384,7 @@ class MultiHttpClient implements LoggerAwareInterface {
 
                curl_setopt( $ch, CURLOPT_HEADERFUNCTION,
                        function ( $ch, $header ) use ( &$req ) {
-                               if ( !empty( $req['flags']['relayResponseHeaders'] ) ) {
+                               if ( !empty( $req['flags']['relayResponseHeaders'] ) && trim( $header ) !== '' ) {
                                        header( $header );
                                }
                                $length = strlen( $header );