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

Handling Zlib::BufError exceptions #337

Closed
brandonweiss opened this issue Jan 30, 2014 · 1 comment
Closed

Handling Zlib::BufError exceptions #337

brandonweiss opened this issue Jan 30, 2014 · 1 comment

Comments

@brandonweiss
Copy link

I'm intermittently seeing Zlib::BufError exceptions being raised when making requests. I'm not setting an Accept-Encoding header allowing compressed content, so presumably this is caused by a server responding with Content-Encoding regardless, and then Net::HTTP trying to decompress the response which is either malformed or not compressed the in the first place.

I'm not quite sure what to do about that? I don't really care about the response, what I'm after is the status code. I could make a HEAD request, but some servers will just a return a 405 because they don't support it.

Is there anything I can do about this other than switching to a different adapter?

@brandonweiss
Copy link
Author

Of course I would finally figure this out minutes after I ask the question. For posterity, setting the Accept-Encoding header to identity will stop Net::HTTP from automatically requesting and/or attempting to inflate a compressed response.

Accept-Encoding: identity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant