Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ensure digest_auth uses the correct method and does not send two requ…

…est with the same body.
  • Loading branch information...
commit 9ea325cf4c5771cfe0b448a2f707fc490a346c9f 1 parent fbde7f1
@oriolgual oriolgual authored committed
Showing with 4 additions and 5 deletions.
  1. +4 −5 lib/httparty/request.rb
View
9 lib/httparty/request.rb
@@ -160,11 +160,10 @@ def setup_raw_request
end
def setup_digest_auth
- if @raw_request.class == Net::HTTP::Get || @raw_request.class == Net::HTTP::Head
- res = http.head(uri.request_uri, options[:headers])
- else
- res = self.last_response = http.request(@raw_request)
- end
+ auth_request = http_method.new(uri.request_uri)
+ auth_request.initialize_http_header(options[:headers])
+ res = http.request(auth_request)
+
if res['www-authenticate'] != nil && res['www-authenticate'].length > 0
@raw_request.digest_auth(username, password, res)
end
Please sign in to comment.
Something went wrong with that request. Please try again.