Issues

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

Description

In Zend\Http\Client::prepareHeaders (https://github.com/zendframework/zf2/…):


        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:


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.

Comments

This issue has been closed on Jira and moved to GitHub for issue tracking. To continue following the resolution of this issues, please visit: https://github.com/zendframework/zf2/issues/2607