]> granicus.if.org Git - python/commitdiff
[Patch #1617413 from Dug Song] Fix HTTP Basic authentication via HTTPS
authorAndrew M. Kuchling <amk@amk.ca>
Tue, 19 Dec 2006 15:11:41 +0000 (15:11 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Tue, 19 Dec 2006 15:11:41 +0000 (15:11 +0000)
Lib/urllib.py

index 064632c260b3f2d34ae55aa624a36a3d80338023..4a1fa64bb4029686282f7fdbf55e7e37ed635860 100644 (file)
@@ -405,8 +405,8 @@ class URLopener:
                 h.putheader('Content-Length', '%d' % len(data))
             else:
                 h.putrequest('GET', selector)
-            if proxy_auth: h.putheader('Proxy-AuthorizationBasic %s' % proxy_auth)
-            if auth: h.putheader('AuthorizationBasic %s' % auth)
+            if proxy_auth: h.putheader('Proxy-Authorization', 'Basic %s' % proxy_auth)
+            if auth: h.putheader('Authorization', 'Basic %s' % auth)
             if realhost: h.putheader('Host', realhost)
             for args in self.addheaders: h.putheader(*args)
             h.endheaders()