aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/lib/active_resource/connection.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activeresource/lib/active_resource/connection.rb')
-rw-r--r--activeresource/lib/active_resource/connection.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/activeresource/lib/active_resource/connection.rb b/activeresource/lib/active_resource/connection.rb
index d923204dde..94839c8c25 100644
--- a/activeresource/lib/active_resource/connection.rb
+++ b/activeresource/lib/active_resource/connection.rb
@@ -122,7 +122,7 @@ module ActiveResource
# Handles response and error codes from the remote service.
def handle_response(response)
case response.code.to_i
- when 301,302
+ when 301, 302, 303, 307
raise(Redirection.new(response))
when 200...400
response
@@ -238,8 +238,11 @@ module ActiveResource
def digest_auth_header(http_method, uri)
params = extract_params_from_response
+ request_uri = uri.path
+ request_uri << "?#{uri.query}" if uri.query
+
ha1 = Digest::MD5.hexdigest("#{@user}:#{params['realm']}:#{@password}")
- ha2 = Digest::MD5.hexdigest("#{http_method.to_s.upcase}:#{uri.path}")
+ ha2 = Digest::MD5.hexdigest("#{http_method.to_s.upcase}:#{request_uri}")
params.merge!('cnonce' => client_nonce)
request_digest = Digest::MD5.hexdigest([ha1, params['nonce'], "0", params['cnonce'], params['qop'], ha2].join(":"))