Comments (3)
An example URL of a deflate'd page that the Gzip middleware fails to handle is given in the above issue.
Zlib::Inflate.inflate
cannot decode a raw deflate stream.
% curl -L -H 'Accept-Encoding: deflate' 'http://jobboerse.arbeitsagentur.de/vamJB/stellenangeboteFinden.html?execution=e1s1' | ruby -rzlib -e 'Zlib::Inflate.inflate($<.read)'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 423 0 423 0 0 623 0 --:--:-- --:--:-- --:--:-- 622
100 451 0 451 0 0 463 0 --:--:-- --:--:-- --:--:-- 463
100 11292 0 11292 0 0 8612 0 --:--:-- 0:00:01 --:--:-- 2661k
-e:1:in `inflate': incorrect header check (Zlib::DataError)
from -e:1:in `<main>'
You can confirm Firefox and Chrome can successfully decode the response content with Content-Encoding: deflate
using the "Network" tab of their developer tools.
/cc @romanbsd
from faraday_middleware.
Here's a repro.
% ruby -rfaraday -rfaraday_middleware -e 'Faraday.new {|b| b.use FaradayMiddleware::FollowRedirects; b.use :gzip; b.adapter Faraday.default_adapter }.get("http://jobboerse.arbeitsagentur.de/vamJB/stellenangeboteFinden.html?execution=e1s1")'
/..prefix../lib/ruby/gems/2.2.0/gems/faraday_middleware-0.10.0/lib/faraday_middleware/gzip.rb:51:in `inflate': incorrect header check (Zlib::DataError)
from /..prefix../lib/ruby/gems/2.2.0/gems/faraday_middleware-0.10.0/lib/faraday_middleware/gzip.rb:51:in `inflate'
from /..prefix../lib/ruby/gems/2.2.0/gems/faraday_middleware-0.10.0/lib/faraday_middleware/gzip.rb:35:in `reset_body'
from /..prefix../lib/ruby/gems/2.2.0/gems/faraday_middleware-0.10.0/lib/faraday_middleware/gzip.rb:29:in `block in call'
from /..prefix../lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/response.rb:57:in `on_complete'
from /..prefix../lib/ruby/gems/2.2.0/gems/faraday_middleware-0.10.0/lib/faraday_middleware/gzip.rb:24:in `call'
from /..prefix../lib/ruby/gems/2.2.0/gems/faraday_middleware-0.10.0/lib/faraday_middleware/response/follow_redirects.rb:76:in `perform_with_redirection
'
from /..prefix../lib/ruby/gems/2.2.0/gems/faraday_middleware-0.10.0/lib/faraday_middleware/response/follow_redirects.rb:82:in `block in perform_with_re
direction'
from /..prefix../lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/response.rb:57:in `on_complete'
from /..prefix../lib/ruby/gems/2.2.0/gems/faraday_middleware-0.10.0/lib/faraday_middleware/response/follow_redirects.rb:78:in `perform_with_redirection
'
from /..prefix../lib/ruby/gems/2.2.0/gems/faraday_middleware-0.10.0/lib/faraday_middleware/response/follow_redirects.rb:82:in `block in perform_with_re
direction'
from /..prefix../lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/response.rb:57:in `on_complete'
from /..prefix../lib/ruby/gems/2.2.0/gems/faraday_middleware-0.10.0/lib/faraday_middleware/response/follow_redirects.rb:78:in `perform_with_redirection
'
from /..prefix../lib/ruby/gems/2.2.0/gems/faraday_middleware-0.10.0/lib/faraday_middleware/response/follow_redirects.rb:64:in `call'
from /..prefix../lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/rack_builder.rb:139:in `build_response'
from /..prefix../lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/connection.rb:377:in `run_request'
from /..prefix../lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/connection.rb:140:in `get'
from -e:1:in `<main>'
from faraday_middleware.
Please review the PR above.
from faraday_middleware.
Related Issues (20)
- RSpec refactoring: JRuby tests skipped using metadata HOT 1
- Deprecation warning re Faraday::Error::ClientError HOT 5
- Autoloads incomplete for FaradayMiddleware::RedirectLimitReached HOT 2
- Add support for Faraday 1.0 HOT 2
- Ship v1.0 HOT 8
- RuboCop Quest Issue HOT 4
- ruby 2.7.0 warnings HOT 2
- Reconsider SafeYAML gem dependency HOT 4
- Turn wiki into docs/ of Markdown HOT 2
- Configure RuboCop cops HOT 1
- Configure Codeclimate RuboCop support
- Gzip middleware seems mandatory when used with json response middleware? HOT 4
- Gemify Rashify middleware HOT 1
- FollowRedirects should disregard content headers HOT 1
- Linting
- CI: Improve GH Actions matrix
- Deprecate `FaradayMiddleware::Instrumentation` in favor of `Faraday::Request::Instrumentation`? HOT 2
- How to follow redirects prompted by DDoS Guards HOT 3
- faraday 2 support HOT 5
- undefined method `dependency' for ActiveCampaign::Faraday::Middleware::Request:Class (NoMethodError) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from faraday_middleware.