Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
Closed
Description
Symfony version(s) affected
7.2.0
Description
Since deploying 7.2.0 in production today we are getting the occasional exception caught by Sentry (of a warning) when making http-client calls to remote sites.
Undefined array key "connection"
https://phil-taylor.sentry.io/share/issue/cf7fdf8815f3437f9faac44fd4d9065c/
The issue seems to have started with the PR#58562
dumping the headersdd($responses[$id]->headers);
of a normal request, I can see there is no array keyconnection
in the headers.
How to reproduce
<?php// composer req symfony/http-client symfony/var-dumperuseSymfony\Component\HttpClient\CurlHttpClient;error_reporting(E_ALL);ini_set('display_errors',1);require'vendor/autoload.php';$client =newCurlHttpClient();$response =$client->request('GET','https://symfony.com/');$content =$response->getContent(false);// then edit CurlResponse.php and dd the headers before line 319
Possible Solution
check the array key exists before use
Additional Context
No response