[前][次][番号順一覧][スレッド一覧]

ruby-changes:69701

From: Shohei <ko1@a...>
Date: Thu, 11 Nov 2021 17:34:10 +0900 (JST)
Subject: [ruby-changes:69701] 52ab9bbee9 (master): [ruby/net-http] Send Accept-Encoding header on HEAD method

https://git.ruby-lang.org/ruby.git/commit/?id=52ab9bbee9

From 52ab9bbee918c63faad32e3851b162691b984d40 Mon Sep 17 00:00:00 2001
From: Shohei Maeda <irt_m.jrsyo@n...>
Date: Sun, 6 Jun 2021 18:49:51 +0900
Subject: [ruby/net-http] Send Accept-Encoding header on HEAD method

https://github.com/ruby/net-http/commit/9d95c5e3e6
---
 lib/net/http/generic_request.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/net/http/generic_request.rb b/lib/net/http/generic_request.rb
index d6198cd6246..313de6ac923 100644
--- a/lib/net/http/generic_request.rb
+++ b/lib/net/http/generic_request.rb
@@ -31,12 +31,12 @@ class Net::HTTPGenericRequest https://github.com/ruby/ruby/blob/trunk/lib/net/http/generic_request.rb#L31
 
     @decode_content = false
 
-    if @response_has_body and Net::HTTP::HAVE_ZLIB then
+    if Net::HTTP::HAVE_ZLIB then
       if !initheader ||
          !initheader.keys.any? { |k|
            %w[accept-encoding range].include? k.downcase
          } then
-        @decode_content = true
+        @decode_content = true if @response_has_body
         initheader = initheader ? initheader.dup : {}
         initheader["accept-encoding"] =
           "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]