From 251f5d8226dbde06ba06e980e3b741b45ae3826d Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Mon, 16 Dec 2019 23:39:10 +0900 Subject: Revert "lib/net/http/response.rb: support raw deflate correctly" This reverts commit 5105240b1e851410020b3b3f1a2bead7ffdd4291. In RFC 2616: ``` deflate The "zlib" format defined in RFC 1950 [31] in combination with the "deflate" compression mechanism described in RFC 1951 [29]. ``` So "Content-Encoding: deflate" means zlib format, not raw deflate. [Bug #11268] --- lib/net/http/response.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/net/http') diff --git a/lib/net/http/response.rb b/lib/net/http/response.rb index 7c89876d44..5a94f95694 100644 --- a/lib/net/http/response.rb +++ b/lib/net/http/response.rb @@ -264,7 +264,7 @@ class Net::HTTPResponse when 'deflate', 'gzip', 'x-gzip' then self.delete 'content-encoding' - inflate_body_io = Inflater.new(@socket, v.downcase == "deflate") + inflate_body_io = Inflater.new(@socket) begin yield inflate_body_io @@ -358,10 +358,10 @@ class Net::HTTPResponse ## # Creates a new Inflater wrapping +socket+ - def initialize(socket, raw_deflate) + def initialize socket @socket = socket # zlib with automatic gzip detection - @inflate = Zlib::Inflate.new(raw_deflate ? -Zlib::MAX_WBITS : 32 + Zlib::MAX_WBITS) + @inflate = Zlib::Inflate.new(32 + Zlib::MAX_WBITS) end ## -- cgit v1.2.3