Open pedigree opened 8 years ago
Removing the automatic accept-encoding
header would be a BC Break.
You can do this:
$client = new ZendHttpClient($uri, $config);
$client->setHeaders([
'accept-encoding' => 'identity',
]);
```
@pedigree There is no issue imho. We have two methods you can get the response content:
getContent
gives you original response content, so it could be gzipped, etc.getBody
gives decoded response content, something you are expecting probably.What's wrong with this approach?
This repository has been closed and moved to laminas/laminas-http; a new issue has been opened at https://github.com/laminas/laminas-http/issues/8.
I could be wrong but please do let me know if this is "as intended" as it seems a bit strange to me.
Reported from PHP 5.6 with curl, and Zend Framework 3.0.0
If I use this test code to pull content from (eg example.com)
then the client generates a header with
Accept-Encoding: gzip, deflate
but this will assert withFailed asserting that Binary String: 0x1f8b08003b81055200038d5441afd ...
If you look at the pcap for the request, this is the raw gzip result (starts at 0x01bb)I believe that if you send Accept headers including gzip and you get gzipped data back then the getContent() function should correctly handle gzipped data, returning the decoded content without having to override with