Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Move [].join

The [].join call was in the wrong spot which meant opaque was tagged onto the end incorrectly.

Fix tests.
  • Loading branch information...
commit 0d7ea1598d3561b647e5268c33059ce598f831e5 1 parent 4f22f68
@gmoore authored
View
4 lib/active_resource/connection.rb
@@ -269,10 +269,10 @@ def auth_attributes_for(uri, request_digest, params)
%Q(nonce="#{params['nonce']}"),
%Q(nc="0"),
%Q(cnonce="#{params['cnonce']}"),
- %Q(response="#{request_digest}")].join(", ")
+ %Q(response="#{request_digest}")]
auth_attrs << %Q(opaque="#{params['opaque']}") unless params['opaque'].blank?
- auth_attrs
+ auth_attrs.join(", ")
end
def http_format_header(http_method)
View
4 test/cases/authorization_test.rb
@@ -238,11 +238,11 @@ def test_raises_invalid_request_on_unauthorized_requests_with_digest_auth
private
def blank_digest_auth_header(uri, response)
- %Q(Digest username="david", realm="", qop="", uri="#{uri}", nonce="", nc="0", cnonce="i-am-a-client-nonce", opaque="", response="#{response}")
+ %Q(Digest username="david", realm="", qop="", uri="#{uri}", nonce="", nc="0", cnonce="i-am-a-client-nonce", response="#{response}")
end
def request_digest_auth_header(uri, response)
- %Q(Digest username="david", realm="RailsTestApp", qop="auth", uri="#{uri}", nonce="#{@nonce}", nc="0", cnonce="i-am-a-client-nonce", opaque="ef6dfb078ba22298d366f99567814ffb", response="#{response}")
+ %Q(Digest username="david", realm="RailsTestApp", qop="auth", uri="#{uri}", nonce="#{@nonce}", nc="0", cnonce="i-am-a-client-nonce", response="#{response}", opaque="ef6dfb078ba22298d366f99567814ffb")
end
def response_digest_auth_header

0 comments on commit 0d7ea15

Please sign in to comment.
Something went wrong with that request. Please try again.