# File lib/vcr/structs.rb, line 432 def self.decompress(body, type) unless HAVE_ZLIB warn "VCR: cannot decompress response; Zlib not available" return end case type when 'gzip' args = [StringIO.new(body)] args << { :encoding => 'ASCII-8BIT' } if ''.respond_to?(:encoding) yield Zlib::GzipReader.new(*args).read when 'deflate' yield Zlib::Inflate.inflate(body) when 'identity', NilClass return else raise Errors::UnknownContentEncodingError, "unknown content encoding: #{type}" end end