[ruby/net-http] Send Accept-Encoding header on HEAD method

https://github.com/ruby/net-http/commit/9d95c5e3e6
This commit is contained in:
Shohei Maeda 2021-06-06 18:49:51 +09:00 committed by git
parent 33533fabd5
commit 52ab9bbee9
1 changed files with 2 additions and 2 deletions

View File

@ -31,12 +31,12 @@ class Net::HTTPGenericRequest
@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"