Skip to content

[HttpClient] URL with colon is not correctly parsed #58313

@philipzeyen

Description

@philipzeyen

Symfony version(s) affected

5.4

Description

The HttpClientTrait::parseUrl Method cannot parse Urls containing a colon correctly.
EDIT: Solution developed in #58218 does not fix this problem

How to reproduce

$client = new NativeHttpClient([ // this client can be replaced with others
    'base_uri' => 'https://host.tld/'
]);
$response = $client->request(Request::METHOD_DELETE, 'foo/bar:1/baz');
// throws following exception: 'Symfony\Component\HttpClient\Exception\TransportException: Could not resolve host "foo"'

Possible Solution

Adding the configured base_uri before calling PHPs parse_url

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