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
Zlib provides automatic gzip detection for you so you don't need to skip over it by hand. From inflateInit2 in the zlib manual (also reflected in the Zlib::Inflate.new documentation):
Add 32 to windowBits to enable zlib and gzip decoding with automatic header detection, or add 16 to decode only the gzip format.
@drbrain thanks for the heads up. It's not clear to me yet if this will break any of the underlying (streaming) use cases.. shouldn't, right? Also, is there a particular reason you raised this issue now -- are you experiencing some trouble with existing code?
I'm not using it but was inspired to look at the code due to a blog post I read that used this gem instead of using Zlib::Inflate directly. I struggled with the same problem as the GzipHeader skipping code this gem uses for Net::HTTP and noticed the special flag in the zlib documentation.
Zlib provides automatic gzip detection for you so you don't need to skip over it by hand. From
inflateInit2
in the zlib manual (also reflected in the Zlib::Inflate.new documentation):So you can replace L228 of EventMachine::HttpDecoders::Gzip with:
And delete the code in GzipHeader to prevent bugs like #284/#301
The text was updated successfully, but these errors were encountered: