forked from postmanlabs/httpbin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Send/require a cookie header on digest-auth
Also fix an import.
- Loading branch information
1 parent
bde5c81
commit 4870f70
Showing
2 changed files
with
5 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -356,8 +356,10 @@ def digest_auth(qop=None, user='user', passwd='passwd'): | |
auth.set_digest('[email protected]', nonce, opaque=opaque, | ||
qop=('auth', 'auth-int') if qop is None else (qop, )) | ||
response.headers['WWW-Authenticate'] = auth.to_header() | ||
response.headers['Set-Cookie'] = 'fake=fake_value' | ||
return response | ||
elif not check_digest_auth(user, passwd): | ||
elif not (check_digest_auth(user, passwd) and | ||
request.headers.get('Cookie')): | ||
return status_code(401) | ||
return jsonify(authenticated=True, user=user) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters