Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decode_content removes header #1397

Closed
phmLabs opened this issue Feb 11, 2016 · 5 comments
Closed

decode_content removes header #1397

phmLabs opened this issue Feb 11, 2016 · 5 comments
Labels

Comments

@phmLabs
Copy link

phmLabs commented Feb 11, 2016

When using the decode_content option the "Content-Encoding" header is removed.

Is it possible to get the header to check if the content was gzipped?

@mtdowling
Copy link
Member

Are you using the curl or streamhandler? Do you know if the behavior between the two is different? If curl isn't removing the header, but the StreamHandler is, then I'd be open to stopping this behavior in the StreamHandler.

@phmLabs
Copy link
Author

phmLabs commented Feb 18, 2016

It seems to be this line:

unset($headers[$normalizedKeys['content-encoding']]);

in

https://github.com/guzzle/guzzle/blob/master/src/Handler/StreamHandler.php

@jeskew
Copy link
Contributor

jeskew commented Feb 23, 2016

@mtdowling
Copy link
Member

It should be noted that others have requested the opposite of what is being proposed in this issue: #1075

@jeskew
Copy link
Contributor

jeskew commented Mar 7, 2016

This was addressed in #1409. Guzzle will add headers containing the original content encoding (x-encoded-content-encoding) and original content length (x-encoded-content-length) and continue removing the content-encoding header and updating the content-length header with the length of the decoded body.

@jeskew jeskew closed this as completed Mar 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants