[Patch #1617413 from Dug Song] Fix HTTP Basic authentication via HTTPS

This commit is contained in:
Andrew M. Kuchling 2006-12-19 15:11:41 +00:00
parent 8d0baae7cd
commit 522785732f
1 changed files with 2 additions and 2 deletions

View 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-Authorization: Basic %s' % proxy_auth)
if auth: h.putheader('Authorization: Basic %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()