From 1771ebd325f496757ab8f3a56018dbfdfcaface6 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Mon, 28 Apr 2025 22:37:03 +0200 Subject: [PATCH] do not lose response information when truncating the debug buffer --- src/Symfony/Component/HttpClient/Response/CurlResponse.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpClient/Response/CurlResponse.php b/src/Symfony/Component/HttpClient/Response/CurlResponse.php index 69b2662fd1252..8ff8586553d2d 100644 --- a/src/Symfony/Component/HttpClient/Response/CurlResponse.php +++ b/src/Symfony/Component/HttpClient/Response/CurlResponse.php @@ -205,7 +205,6 @@ public function getInfo(?string $type = null): mixed { if (!$info = $this->finalInfo) { $info = array_merge($this->info, curl_getinfo($this->handle)); - $info['url'] = $this->info['url'] ?? $info['url']; $info['redirect_url'] = $this->info['redirect_url'] ?? null; // workaround curl not subtracting the time offset for pushed responses @@ -221,6 +220,7 @@ public function getInfo(?string $type = null): mixed rewind($this->debugBuffer); ftruncate($this->debugBuffer, 0); } + $this->info = array_merge($this->info, $info); $waitFor = curl_getinfo($this->handle, \CURLINFO_PRIVATE); if ('H' !== $waitFor[0] && 'C' !== $waitFor[0]) {