Oneshot decompressor, due to lack of a streaming Gzip reader implementation. We may steal code from Zliby to improve this.
For now, do not put `gzip’ or `compressed’ in your accept-encoding header if you expect much data through the :on_response interface.
# File lib/em-http/decoders.rb, line 105 def decompress(compressed) @buf ||= '' @buf += compressed nil end
# File lib/em-http/decoders.rb, line 111 def finalize begin Zlib::GzipReader.new(StringIO.new(@buf.to_s)).read rescue Zlib::Error raise DecoderError end end
# File lib/em-http/decoders.rb, line 101 def self.encoding_names %w(gzip compressed) end