[HttpClient] may leak InvalidArgumentException for malformed location
header on redirect
#58857
Labels
8000
location
header on redirect
#58857
Symfony version(s) affected
git 7.2
Description
When the returned
location
header for a 3xx HTTP response is of the formhttp:[a-z]+
, Symfony HTTP client will throwSymfony\Component\HttpClient\Exception\InvalidArgumentException
, which is not a legal Exception according to the contract of the HttpClient.It should throw
RedirectionException
instead.How to reproduce
running against redirect.php:
with PHP's embedded HTTP server:
results in:
Possible Solution
This is related to #58836, which fixed the
location
header parsing for non-http
schemes, e.g.location: localhost:8080
.Additional Context
No response
The text was updated successfully, but these errors were encountered: