You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
...
7: from vendor/bundle/ruby/2.6.0/gems/http-4.4.1/lib/http/chainable.rb:20:in `get'
6: from vendor/bundle/ruby/2.6.0/gems/http-4.4.1/lib/http/client.rb:34:in `request'
5: from vendor/bundle/ruby/2.6.0/gems/http-4.4.1/lib/http/redirector.rb:59:in `perform'
4: from vendor/bundle/ruby/2.6.0/gems/http-4.4.1/lib/http/response.rb:94:in `flush'
3: from vendor/bundle/ruby/2.6.0/gems/http-4.4.1/lib/http/response/body.rb:51:in `to_s'
2: from vendor/bundle/ruby/2.6.0/gems/http-4.4.1/lib/http/response/inflater.rb:19:in `readpartial'
1: from vendor/bundle/ruby/2.6.0/gems/http-4.4.1/lib/http/response/inflater.rb:19:in `finish'
Zlib::BufError (buffer error)
If you fetch the URL without use(:auto_inflate), read the body into a string, then feed it into Zlib in full, then it's correctly decoded without errors:
IMO returned response is faulty. It shouldn't contain Content-Encoding header if body is not compressed.
On the other hand it should be easy to "fix" it on http-rb side by skipping decompression when body is flushed.
Example request:
immediately raises:
If you fetch the URL without
use(:auto_inflate)
, read the body into a string, then feed it into Zlib in full, then it's correctly decoded without errors:It must be related to how the chunks are read but I don't know enough about Zlib to understand why.
The text was updated successfully, but these errors were encountered: