Skip to content

Commit

Permalink
Changed Authorization.qop type from HeaderSet to string
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Hunsinger committed Aug 14, 2016
1 parent da16933 commit 9f56926
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion tests/test_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def test_authorization_header(self):
assert a.realm == '[email protected]'
assert a.nonce == 'dcd98b7102dd2f0e8b11d0f600bfb0c093'
assert a.uri == '/dir/index.html'
assert 'auth' in a.qop
assert a.qop == 'auth'
assert a.nc == '00000001'
assert a.cnonce == '0a4f113b'
assert a.response == '6629fae49393a05397450978507c4ef1'
Expand Down
15 changes: 4 additions & 11 deletions werkzeug/datastructures.py
Original file line number Diff line number Diff line change
Expand Up @@ -2430,17 +2430,10 @@ def __init__(self, auth_type, data=None):
The opaque header from the server returned unchanged by the client.
It is recommended that this string be base64 or hexadecimal data.
Digest auth only.''')

@property
def qop(self):
"""Indicates what "quality of protection" the client has applied to
the message for HTTP digest auth."""
def on_update(header_set):
if not header_set and 'qop' in self:
del self['qop']
elif header_set:
self['qop'] = header_set.to_header()
return parse_set_header(self.get('qop'), on_update)
qop = property(lambda x: x.get('qop'), doc='''
Indicates what "quality of protection" the client has applied to
the message for HTTP digest auth. Note that this is a single token,
not a quoted list of alternatives as in WWW-Authenticate.''')


class WWWAuthenticate(UpdateDictMixin, dict):
Expand Down

0 comments on commit 9f56926

Please sign in to comment.