From be745932f955e9197f0b9d1e569cc27238546daa Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Fri, 25 Aug 2017 19:53:44 +0200 Subject: [PATCH] Reset previous response headers before curl_exec Using the same client instance, if you perform a normal request and then a request using an output stream, the headers of the first request will be kept, resulting in two set of headers in the second call. This causes all sort of errors, for instance Too much content was extracted from the stream (X instead of Y bytes) --- src/Client/Adapter/Curl.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Client/Adapter/Curl.php b/src/Client/Adapter/Curl.php index 37620e9cfd..1bbcb18fae 100644 --- a/src/Client/Adapter/Curl.php +++ b/src/Client/Adapter/Curl.php @@ -437,6 +437,8 @@ public function write($method, $uri, $httpVersion = 1.1, $headers = [], $body = } } + $this->response = ''; + // send the request $response = curl_exec($this->curl);