fix HEAD requests with Net:HTTP

Net::HTTP on Ruby 1.9.3p0 would spend insane amount of time (~30s) per
request waiting to get response body from a HEAD request.
This commit is contained in:
Mislav Marohnić 2011-12-29 01:55:59 +01:00
parent 2690c6f972
commit fdabbc1b29

View File

@ -43,8 +43,8 @@ module Faraday
if :get != env[:method]
http_request = Net::HTTPGenericRequest.new \
env[:method].to_s.upcase, # request method
!!env[:body], # is there data
true, # does net/http love you, true or false?
!!env[:body], # is there request body
:head != env[:method], # is there response body
url.request_uri, # request uri path
env[:request_headers] # request headers