diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-01-02 12:07:04 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-01-02 12:07:04 +0000 |
commit | 2743ad8c25dd6b3f96372a0cb24b22a0779e895d (patch) | |
tree | 023792b816037d727ee8f105c2c7928c36686efe | |
parent | 57ee6eae5a133952b5f7ce8abe5d8b99e60fd7a8 (diff) | |
download | ruby-2743ad8c25dd6b3f96372a0cb24b22a0779e895d.tar.gz |
* 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
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/net/http.rb | 3 |
2 files changed, 7 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Fri Jan 2 21:06:59 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com> + + * lib/net/http.rb (Net::HTTP#send_request): there is no response body + with HEAD request. Patch by @rodrigosaito [fix GH-520] + Fri Jan 2 21:04:36 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com> * test/net/http/test_http.rb (_test_send_request__HEAD): Added diff --git a/lib/net/http.rb b/lib/net/http.rb index 957cb358b2..03823ae735 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 |