From: Andrew M. Kuchling Date: Fri, 29 Aug 2003 18:12:23 +0000 (+0000) Subject: [Bug #776542] open_https() generates a bad Authorization header because it calls... X-Git-Tag: v2.4a1~1694 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ff638ea6dbc7ff6819a083f9a9562a8099accade;p=python [Bug #776542] open_https() generates a bad Authorization header because it calls .putheader() wrongly. Reported by Steffen Ries. --- diff --git a/Lib/urllib.py b/Lib/urllib.py index 494f578ec6..5449104bf7 100644 --- a/Lib/urllib.py +++ b/Lib/urllib.py @@ -369,7 +369,7 @@ class URLopener: h.putheader('Content-length', '%d' % len(data)) else: 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) for args in self.addheaders: h.putheader(*args) h.endheaders()