mirror of https://github.com/python/cpython
[Patch #1617413 from Dug Song] Fix HTTP Basic authentication via HTTPS
This commit is contained in:
parent
e6acc8718c
commit
0faf90acc4
|
@ -405,8 +405,8 @@ class URLopener:
|
||||||
h.putheader('Content-Length', '%d' % len(data))
|
h.putheader('Content-Length', '%d' % len(data))
|
||||||
else:
|
else:
|
||||||
h.putrequest('GET', selector)
|
h.putrequest('GET', selector)
|
||||||
if proxy_auth: h.putheader('Proxy-Authorization: Basic %s' % proxy_auth)
|
if proxy_auth: h.putheader('Proxy-Authorization', 'Basic %s' % proxy_auth)
|
||||||
if auth: h.putheader('Authorization: Basic %s' % auth)
|
if auth: h.putheader('Authorization', 'Basic %s' % auth)
|
||||||
if realhost: h.putheader('Host', realhost)
|
if realhost: h.putheader('Host', realhost)
|
||||||
for args in self.addheaders: h.putheader(*args)
|
for args in self.addheaders: h.putheader(*args)
|
||||||
h.endheaders()
|
h.endheaders()
|
||||||
|
|
Loading…
Reference in New Issue