mirror of
https://github.com/kennethreitz/httpbin.git
synced 2026-06-05 23:00:18 +00:00
Encode HA2() string parameters 'method', 'uri' and 'H(entityBody)'
This fixes error 500, when httpbin is run with python3 and digest-auth is attempted with qop='auth-int'.
This commit is contained in:
+4
-3
@@ -292,9 +292,10 @@ def HA2(credentails, request, algorithm):
|
||||
for k in 'method', 'uri', 'body':
|
||||
if k not in request:
|
||||
raise ValueError("%s required" % k)
|
||||
return H("%s:%s:%s" % (request['method'],
|
||||
request['uri'],
|
||||
H(request['body'], algorithm)), algorithm)
|
||||
A2 = b":".join([request['method'].encode('utf-8'),
|
||||
request['uri'].encode('utf-8'),
|
||||
H(request['body'], algorithm).encode('utf-8')])
|
||||
return H(A2, algorithm)
|
||||
raise ValueError
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user