Class: HTTPClient::Session::LenientInflater

Inherits:
Object
  • Object
show all
Defined in:
lib/httpclient/session.rb

Overview

This inflater allows deflate compression with/without zlib header

Instance Method Summary collapse

Constructor Details

#initializeLenientInflater

Returns a new instance of LenientInflater.



660
661
662
663
# File 'lib/httpclient/session.rb', line 660

def initialize
  @inflater = Zlib::Inflate.new(Zlib::MAX_WBITS)
  @first = true
end

Instance Method Details

#inflate(body) ⇒ Object



665
666
667
668
669
670
671
# File 'lib/httpclient/session.rb', line 665

def inflate(body)
  if @first
    first_inflate(body)
  else
    @inflater.inflate(body)
  end
end