Commit 0faf90ac authored by Andrew M. Kuchling's avatar Andrew M. Kuchling

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

parent e6acc871
......@@ -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()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment