From db0757970b3e1b668ab522dd38c437659a0ae93b Mon Sep 17 00:00:00 2001 From: Karuna Govind Date: Mon, 22 Feb 2016 23:11:50 +0000 Subject: [PATCH] #50 - curl http header replacement needs to be case insensitive --- src/Client/Adapter/Curl.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Client/Adapter/Curl.php b/src/Client/Adapter/Curl.php index 267f0c86f2..8125f6de5b 100644 --- a/src/Client/Adapter/Curl.php +++ b/src/Client/Adapter/Curl.php @@ -434,18 +434,18 @@ public function write($method, $uri, $httpVersion = 1.1, $headers = [], $body = // cURL automatically decodes chunked-messages, this means we have to // disallow the Zend\Http\Response to do it again. - $responseHeaders = preg_replace("/Transfer-Encoding:\s*chunked\\r\\n/", "", $responseHeaders); + $responseHeaders = preg_replace("/Transfer-Encoding:\s*chunked\\r\\n/i", '', $responseHeaders); // cURL can automatically handle content encoding; prevent double-decoding from occurring if (isset($this->config['curloptions'][CURLOPT_ENCODING]) && '' == $this->config['curloptions'][CURLOPT_ENCODING] ) { - $responseHeaders = preg_replace("/Content-Encoding:\s*gzip\\r\\n/", '', $responseHeaders); + $responseHeaders = preg_replace("/Content-Encoding:\s*gzip\\r\\n/i", '', $responseHeaders); } // cURL automatically handles Proxy rewrites, remove the "HTTP/1.0 200 Connection established" string: $responseHeaders = preg_replace( - "/HTTP\/1.0\s*200\s*Connection\s*established\\r\\n\\r\\n/", + "/HTTP\/1.0\s*200\s*Connection\s*established\\r\\n\\r\\n/i", '', $responseHeaders );