lib/httpx/plugins/authentication/digest.rb in httpx-0.23.4 vs lib/httpx/plugins/authentication/digest.rb in httpx-0.24.0
- old
+ new
@@ -43,11 +43,10 @@
alg = Regexp.last_match(1)
algorithm = ::Digest.const_get(alg)
raise DigestError, "unknown algorithm \"#{alg}\"" unless algorithm
sess = Regexp.last_match(2)
- params.delete("algorithm")
else
algorithm = ::Digest::MD5
end
if qop || sess
@@ -75,14 +74,14 @@
%(nonce="#{nonce}"),
%(uri="#{uri}"),
%(response="#{algorithm.hexdigest(request_digest)}"),
]
header << %(realm="#{params["realm"]}") if params.key?("realm")
- header << %(algorithm=#{params["algorithm"]}") if params.key?("algorithm")
- header << %(opaque="#{params["opaque"]}") if params.key?("opaque")
+ header << %(algorithm=#{params["algorithm"]}) if params.key?("algorithm")
header << %(cnonce="#{cnonce}") if cnonce
header << %(nc=#{nc})
header << %(qop=#{qop}) if qop
+ header << %(opaque="#{params["opaque"]}") if params.key?("opaque")
header.join ", "
end
def make_cnonce
::Digest::MD5.hexdigest [