diff options
author | Senthil Kumaran <orsenthil@gmail.com> | 2009-11-15 08:45:27 (GMT) |
---|---|---|
committer | Senthil Kumaran <orsenthil@gmail.com> | 2009-11-15 08:45:27 (GMT) |
commit | b58474f8c7d78057debf4d50854faf358b81e5b6 (patch) | |
tree | 5d95c548ef6821616b7299deb59b26c0ba9cca3f /Lib/urllib/request.py | |
parent | 04454cd60de6a1ee7e598cc4f31342eadf12a92e (diff) | |
download | cpython-b58474f8c7d78057debf4d50854faf358b81e5b6.zip cpython-b58474f8c7d78057debf4d50854faf358b81e5b6.tar.gz cpython-b58474f8c7d78057debf4d50854faf358b81e5b6.tar.bz2 |
Merged revisions 76290 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
................
r76290 | senthil.kumaran | 2009-11-15 14:13:45 +0530 (Sun, 15 Nov 2009) | 10 lines
Merged revisions 76288 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r76288 | senthil.kumaran | 2009-11-15 14:06:20 +0530 (Sun, 15 Nov 2009) | 3 lines
Fix for Issue4683 - urllib2.HTTPDigestAuthHandler fails on third hostname?.
Resolution: Reset the nonce value for each unique nonce (as per RFC 2617)
........
................
Diffstat (limited to 'Lib/urllib/request.py')
-rw-r--r-- | Lib/urllib/request.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index 4ed46ff..b977099 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -847,6 +847,7 @@ class AbstractDigestAuthHandler: self.add_password = self.passwd.add_password self.retried = 0 self.nonce_count = 0 + self.last_nonce = None def reset_retry_count(self): self.retried = 0 @@ -922,7 +923,11 @@ class AbstractDigestAuthHandler: # XXX selector: what about proxies and full urls req.selector) if qop == 'auth': - self.nonce_count += 1 + if nonce == self.last_nonce: + self.nonce_count += 1 + else: + self.nonce_count = 1 + self.last_nonce = nonce ncvalue = '%08x' % self.nonce_count cnonce = self.get_cnonce(nonce) noncebit = "%s:%s:%s:%s:%s" % (nonce, ncvalue, cnonce, qop, H(A2)) |