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.



673
674
675
676
# File 'lib/httpclient/session.rb', line 673

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

Instance Method Details

#inflate(body) ⇒ Object



678
679
680
681
682
683
684
# File 'lib/httpclient/session.rb', line 678

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