summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--lib/net/http.rb3
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f7e6ac2c7e7..878975a33ab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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 957cb358b2a..03823ae7352 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