Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[HttpClient] Undefined array key "connection" #59039

Copy link
Copy link
Closed
@PhilETaylor

Description

@PhilETaylor
Issue body actions

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 headers dd($responses[$id]->headers); of a normal request, I can see there is no array key connection in the headers.

How to reproduce

<?php
// composer req symfony/http-client symfony/var-dumper

use Symfony\Component\HttpClient\CurlHttpClient;

error_reporting(E_ALL);
ini_set('display_errors',1);

require 'vendor/autoload.php';

$client = new CurlHttpClient();

$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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.