mirror of
https://github.com/lostisland/faraday.git
synced 2025-08-29 00:03:58 -04:00
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:
parent
2690c6f972
commit
fdabbc1b29
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user