From 21857a1edb5a69f16fb72cf2a90af7ef86606142 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 12 Jun 2019 15:33:27 +0200 Subject: [PATCH] [HttpClient] fix closing debug stream prematurely --- src/Symfony/Component/HttpClient/Response/CurlResponse.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpClient/Response/CurlResponse.php b/src/Symfony/Component/HttpClient/Response/CurlResponse.php index 1c5114e92f..0c615bab04 100644 --- a/src/Symfony/Component/HttpClient/Response/CurlResponse.php +++ b/src/Symfony/Component/HttpClient/Response/CurlResponse.php @@ -168,8 +168,8 @@ final class CurlResponse implements ResponseInterface rewind($this->debugBuffer); $info['debug'] = stream_get_contents($this->debugBuffer); curl_setopt($this->handle, CURLOPT_VERBOSE, false); - fclose($this->debugBuffer); - $this->debugBuffer = null; + rewind($this->debugBuffer); + ftruncate($this->debugBuffer, 0); $this->finalInfo = $info; } }