]> granicus.if.org Git - python/commitdiff
Patch #994595: Recognize Basic auth even if other schemes are offered.
authorMartin v. Löwis <martin@v.loewis.de>
Tue, 3 Aug 2004 12:59:55 +0000 (12:59 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Tue, 3 Aug 2004 12:59:55 +0000 (12:59 +0000)
Will backport to 2.3.

Lib/urllib2.py
Misc/NEWS

index 8d38749f72014947ebec227cc1e9159c11e541a9..c525f8ca2324b7ac5add8ecccacdc05fa9315b39 100644 (file)
@@ -714,7 +714,7 @@ class AbstractBasicAuthHandler:
         # XXX could be multiple headers
         authreq = headers.get(authreq, None)
         if authreq:
-            mo = AbstractBasicAuthHandler.rx.match(authreq)
+            mo = AbstractBasicAuthHandler.rx.search(authreq)
             if mo:
                 scheme, realm = mo.groups()
                 if scheme.lower() == 'basic':
index edd59896503fdf65e88f6220d223facf4d89bd02..291cc772295f24b356a5e7d2783324e4dc731ac1 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -72,6 +72,9 @@ Extension modules
 Library
 -------
 
+- urllib2 now recognizes Basic authentication even if other authentication
+  schemes are offered.
+
 - Bug #1001053.  wave.open() now accepts unicode filenames.
 
 - gzip.GzipFile has a new fileno() method, to retrieve the handle of the