summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-16 07:50:04 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-16 07:50:04 +0000
commit008c7b108ba6eba727511fd9b03e9b8f8f69b38f (patch)
tree51590ab83a7fd32b1812a21a455809bc8a5575a3 /lib
parentdd52ab5a952190bd43f3a90270cdf52c8bb41dee (diff)
merge revision(s) 49104,49105: [Backport #10692]
* test/net/http/test_http.rb (_test_send_request__HEAD): Added failing test for send_request with HEAD method. * 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/branches/ruby_2_2@49278 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 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