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
Handling of empty responses when dealing with GZip #2177
Comments
Basically I'm not able to find a way to determine if the incoming response stream contains any data prior piping it to zlib. So the underlying zlib module throws and the error is being forwarded to the end user. Unfortunately at this point your only option would be to swallow the error. |
As mentioned in RFC 7230, it seems that there are well defined conditions under which a response may have no body.
and
In these scenarios at least, can we ensure that For example, having a |
That sounds reasonable, though as you are aware handling those status codes does not guarantee no errors. Errors should be forwarded always, that's the point, the status code check should be placed before piping to zlib (we are on the same page). |
Yep, I agree with you.. |
Implemented in #2176 |
This is a continuation of the discussion in #2176
Basically, what should
request
do when a server returns an empty response with theContent-Encoding
header set togzip
?The text was updated successfully, but these errors were encountered: