-
-
Notifications
You must be signed in to change notification settings - Fork 165
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
Zlib::BufError #125
Comments
Thanks for the report. I confirm I get this on Ruby 2.1, this is the related exception: http://ruby-doc.org/stdlib-2.2.0/libdoc/zlib/rdoc/Zlib/BufError.html On Ruby 2.2, I get this instead: TypeError: exception object expected
from /Users/jaime/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/net/http/response.rb:266:in `raise' What's your Ruby version? |
There seems to be a bug on Ruby's Net::HTTP. We need to understand this in order to find the cure, as Net:HTTP is the adapter we're using: I've tried using Excon as the adapter, and in that case the exception raised is |
Found it! It seems to be related with servers returning malformed compressed responses and Net::HTTP trying to decompress them. A better explanation can be found here: A workaround is using these headers: MetaInspector.new(url, headers: {'Accept-Encoding' => 'identity'}) |
I think this is a good default header, so I've released 4.4.0 that includes this. |
@jaimeiniesta Awesome :) Thanks a lot for your reactivity and this awesome gem ! |
You're welcome! Thanks for catching this. |
This code raises an Zlib::BufError, for this specific url.
Is it possible to find a workaround? Or is the response is just not acceptable to be able to extract something?
Thanks
The text was updated successfully, but these errors were encountered: