Skip to content
Myr

Quote qop values in digest auth.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Cory Benfield · committed by Cory Benfield · parent 8477355 · Browse files · 2 files+10 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+10 added−2 removed

  • other:+10 added−2 removed

2 files+10 added−2 removed

modified:requests/auth.py+2 added-2 removed
103 unmodified lines
104 path += '?' + p_parsed.query105106 A1 = '%s:%s:%s' % (self.username, realm, self.password)107 A2 = '%s:%s' % (method, path)108 108109 HA1 = hash_utf8(A1)110 HA2 = hash_utf8(A2)111112 if nonce == self.last_nonce:
30 unmodified lines
143 base += ', algorithm="%s"' % algorithm144 if entdig:145 base += ', digest="%s"' % entdig146 if qop:147 base += ', qop=auth, nc=%s, cnonce="%s"' % (ncvalue, cnonce)147 base += ', qop="auth", nc=%s, cnonce="%s"' % (ncvalue, cnonce)148149 return 'Digest %s' % (base)150151 def handle_401(self, r, **kwargs):
43 unmodified lines
modified:test_requests.py+8 added
318 unmodified lines
319 s.auth = auth320 r = s.get(url)321 assert r.status_code == 401322323 def test_DIGESTAUTH_QUOTES_QOP_VALUE(self):324325 auth = HTTPDigestAuth('user', 'pass')326 url = httpbin('digest-auth', 'auth', 'user', 'pass')327328 r = requests.get(url, auth=auth)329 assert '"auth"' in r.request.headers['Authorization']330331 def test_POSTBIN_GET_POST_FILES(self):332333 url = httpbin('post')334 post1 = requests.post(url).raise_for_status()
588 unmodified lines