Commit ff638ea6 authored by Andrew M. Kuchling's avatar Andrew M. Kuchling

[Bug #776542] open_https() generates a bad Authorization header because it...

[Bug #776542] open_https() generates a bad Authorization header because it calls .putheader() wrongly.  Reported by Steffen Ries.
parent 77ad8292
...@@ -369,7 +369,7 @@ class URLopener: ...@@ -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()
......
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