Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ff638ea

Browse files
committed
[Bug #776542] open_https() generates a bad Authorization header because it calls .putheader() wrongly. Reported by Steffen Ries.
1 parent 77ad829 commit ff638ea

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/urllib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ def open_https(self, url, data=None):
369369
h.putheader('Content-length', '%d' % len(data))
370370
else:
371371
h.putrequest('GET', selector)
372-
if auth: h.putheader('Authorization: Basic %s' % auth)
372+
if auth: h.putheader('Authorization', 'Basic %s' % auth)
373373
if realhost: h.putheader('Host', realhost)
374374
for args in self.addheaders: h.putheader(*args)
375375
h.endheaders()

0 commit comments

Comments
 (0)