-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Closed
Description
Symfony version(s) affected
7.3.4
Description
AMP's default body size limit of 10 MiB is disabled when making a request: https://github.com/symfony/http-client/blob/439032bdff3a5bd07f4e68ef6a93b51bb477400f/AmpHttpClient.php#L128
However, when a redirect happens a new request is created that does not disable this limit: https://github.com/symfony/http-client/blob/439032bdff3a5bd07f4e68ef6a93b51bb477400f/Response/AmpResponseV5.php#L325
This means that a > 10 MiB page/file that requires a redirect will not finish downloading.
How to reproduce
A real life example of a file that will not download with a fresh client is https://github.com/sapics/ip-location-db/raw/main/geolite2-city/geolite2-city-ipv4-num.csv.gz. Code to reproduce:
$client = new AmpHttpClient();
$response = $client->request('https://github.com/sapics/ip-location-db/raw/main/geolite2-city/geolite2-city-ipv4-num.csv.gz');
$response->getContent(); // warning/exceptionPossible Solution
Additional Context
No response