ZF2-582: Unable to set explicit Accept-Encoding header in Zend\Http\Client due to (perhaps) obsolete code

Issue Type: Bug Created: 2012-09-25T07:50:43.000+0000 Last Updated: 2012-10-08T20:11:03.000+0000 Status: Closed Fix version(s): Reporter: Ivan Novakov (commanche) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend\Http

Related issues: Attachments:


In Zend\Http\Client::prepareHeaders (…):

<pre class="highlight">
        if (! isset($this->headers['accept-encoding'])) {
            if (function_exists('gzinflate')) {
                $headers['Accept-encoding'] = 'gzip, deflate';
            } else {
                $headers['Accept-encoding'] = 'identity';

The "$this->headers" property is not used anywhere else, perhaps the "if" line should be something like that, according to the surrounding code:

<pre class="highlight">
if (!$this->getRequest()->getHeaders()->has('Accept-Encoding')) {

Now the condition is always true and there is no other option to disable gzip in the HTTP response than removing the gzip PHP extension.


Posted by Ralph Schindler (ralph) on 2012-10-08T20:11:03.000+0000

This issue has been closed on Jira and moved to GitHub for issue tracking. To continue following the resolution of this issues, please visit:

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.