Skip to content

Commit

Permalink
Merge pull request #26 from smaeda-ks/send-ae-on-head-request-method
Browse files Browse the repository at this point in the history
Send Accept-Encoding header on HEAD method
  • Loading branch information
nurse authored Nov 11, 2021
2 parents 5cf7437 + 9d95c5e commit 3ffb4fe
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 3ffb4fe

Please sign in to comment.