summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-02 12:07:04 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-02 12:07:04 +0000
commit2743ad8c25dd6b3f96372a0cb24b22a0779e895d (patch)
tree023792b816037d727ee8f105c2c7928c36686efe /lib
parent57ee6eae5a133952b5f7ce8abe5d8b99e60fd7a8 (diff)
* lib/net/http.rb (Net::HTTP#send_request): there is no response body
with HEAD request. Patch by @rodrigosaito [fix GH-520] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/net/http.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb
index 957cb35..03823ae 100644
--- a/lib/net/http.rb
+++ b/lib/net/http.rb
@@ -1350,7 +1350,8 @@ module Net #:nodoc:
# puts response.body
#
def send_request(name, path, data = nil, header = nil)
- r = HTTPGenericRequest.new(name,(data ? true : false),true,path,header)
+ has_response_body = name != 'HEAD'
+ r = HTTPGenericRequest.new(name,(data ? true : false),has_response_body,path,header)
request r, data
end