Skip to content

[HttpClient] "Value of type null is not callable" in CurlResponse #60219

@dkarlovi

Description

@dkarlovi

Symfony version(s) affected

7.2.4

Description

Callable passed is nullable, but it's not null checked before being used in

if (null === $info['redirect_url'] = $resolveRedirect($ch, $location, $noContent)) {

How to reproduce

framework:
    http_client:
        default_options:
            headers:
                'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 12_3_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.88 Safari/537.36'
            max_redirects: 10

GET URL https://time.com/5552679/impeached-presidents/

Possible Solution

No response

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