If a response redirects, it sends back raw gzip instead of decoded content
Bilge opened this issue · comments
Bilge commented
Somewhere between beta 9 and 11, but probably in beta 11, redirects cause raw gzip instead of decoded content to be emitted in the body.
$client = HttpClientBuilder::buildDefault();
$response = $client->request(new Request('https://steamcommunity.com/profiles/76561197960287930')); // redirects
$body = $response->getBody()->read(); // gzip
$client = HttpClientBuilder::buildDefault();
$response = $client->request(new Request('https://steamcommunity.com/id/GabeLoganNewell/')); // canonical URL (doesn't redirect)
$body = $response->getBody()->read(); // HTML
Niklas Keller commented
This is caused by FollowRedirects
and DecompressResponse
interaction. FollowRedirects
copies the headers to the new request. DecompressResponse
then thinks the application set the header, so it skips doing anything.