Skip to content

Commit 3ffb4fe

Browse files
authored
Merge pull request #26 from smaeda-ks/send-ae-on-head-request-method
Send Accept-Encoding header on HEAD method
2 parents 5cf7437 + 9d95c5e commit 3ffb4fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/net/http/generic_request.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ def initialize(m, reqbody, resbody, uri_or_path, initheader = nil)
3131

3232
@decode_content = false
3333

34-
if @response_has_body and Net::HTTP::HAVE_ZLIB then
34+
if Net::HTTP::HAVE_ZLIB then
3535
if !initheader ||
3636
!initheader.keys.any? { |k|
3737
%w[accept-encoding range].include? k.downcase
3838
} then
39-
@decode_content = true
39+
@decode_content = true if @response_has_body
4040
initheader = initheader ? initheader.dup : {}
4141
initheader["accept-encoding"] =
4242
"gzip;q=1.0,deflate;q=0.6,identity;q=0.3"

0 commit comments

Comments
 (0)