mirror of
https://github.com/python/cpython.git
synced 2025-11-09 14:06:30 +00:00
[Bug #776542] open_https() generates a bad Authorization header because it calls .putheader() wrongly. Reported by Steffen Ries.
This commit is contained in:
parent
77ad829261
commit
ff638ea6db
1 changed files with 1 additions and 1 deletions
|
|
@ -369,7 +369,7 @@ 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 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…
Add table
Add a link
Reference in a new issue