]> granicus.if.org Git - python/commit
Fix SF bug 468948 & 451295: urllib2 authentication problems
authorJeremy Hylton <jeremy@alum.mit.edu>
Fri, 9 Nov 2001 16:46:51 +0000 (16:46 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Fri, 9 Nov 2001 16:46:51 +0000 (16:46 +0000)
commit52a17becbcc8bba8d4750926c58f6ac6e41464b7
tree3fe54eea69cba3a671c9d03d85d9ee179bc58b55
parent6383c2d1a677f168ed2a4dfc9cb28f93ec327a0e
Fix SF bug 468948 & 451295: urllib2 authentication problems

Fix contributed by Jeffrey C. Ollie.

I haven't tested the fix because the situation is non-trivial to
reproduce.

The basic solution is to get rid of the __current_realm attribute of
authentication handlers.  Instead, prevent infinite retries by
checking for the presence of an Authenticate: header in the request
object that exactly matches the Authenticate: header that would be
added.

The problem prevent authentication from working correctly in the
presence of retries.

Ollie mentioned that digest authentication has the same problem and I
applied the same solution there.
Lib/urllib2.py