mirror of
https://github.com/kennethreitz/httpbin.git
synced 2026-06-05 23:00:18 +00:00
Merge pull request #171 from msabramo/GH-162
GH-162: No 500 w/ better handle missing dict keys
This commit is contained in:
+2
-2
@@ -297,7 +297,7 @@ def response(credentails, password, request):
|
||||
if credentails.get('qop') is None:
|
||||
response = H(b":".join([
|
||||
HA1_value.encode('utf-8'),
|
||||
credentails.get('nonce').encode('utf-8'),
|
||||
credentails.get('nonce', '').encode('utf-8'),
|
||||
HA2_value.encode('utf-8')
|
||||
]))
|
||||
elif credentails.get('qop') == 'auth' or credentails.get('qop') == 'auth-int':
|
||||
@@ -326,6 +326,6 @@ def check_digest_auth(user, passwd):
|
||||
response_hash = response(credentails, passwd, dict(uri=request.path,
|
||||
body=request.data,
|
||||
method=request.method))
|
||||
if credentails['response'] == response_hash:
|
||||
if credentails.get('response') == response_hash:
|
||||
return True
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user