diff --git a/lib/net/http/response.rb b/lib/net/http/response.rb index cbe16ca2..bffa6b24 100644 --- a/lib/net/http/response.rb +++ b/lib/net/http/response.rb @@ -263,7 +263,6 @@ def inflater # :nodoc: case v&.downcase when 'deflate', 'gzip', 'x-gzip' then self.delete 'content-encoding' - had_content_length = self.delete 'content-length' inflate_body_io = Inflater.new(@socket) @@ -273,7 +272,7 @@ def inflater # :nodoc: ensure begin inflate_body_io.finish - if had_content_length + if self['content-length'] self['content-length'] = inflate_body_io.bytes_inflated.to_s end rescue => err