diff --git a/lib/vcr/structs.rb b/lib/vcr/structs.rb index 515ca83f..2e01136c 100644 --- a/lib/vcr/structs.rb +++ b/lib/vcr/structs.rb @@ -395,7 +395,9 @@ def self.decompress(body, type) case type when 'gzip' - yield Zlib::GzipReader.new(StringIO.new(body), encoding: 'ASCII-8BIT').read + 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