Skip to content

Commit

Permalink
[ruby/net-http] Send Accept-Encoding header on HEAD method
Browse files Browse the repository at this point in the history
  • Loading branch information
smaeda-ks authored and matzbot committed Nov 11, 2021
1 parent 33533fa commit 52ab9bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/net/http/generic_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ def initialize(m, reqbody, resbody, uri_or_path, initheader = nil)

@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"
Expand Down

0 comments on commit 52ab9bb

Please sign in to comment.