summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2006-12-19 15:11:41 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2006-12-19 15:11:41 (GMT)
commit522785732f09b0be6d4bc06a2782ecda66fc83af (patch)
tree6c05efc32b0c9b7415e7a12912ee10b07946ef9d
parent8d0baae7cd00fb16bbdf79c4650e18a4c513474c (diff)
downloadcpython-522785732f09b0be6d4bc06a2782ecda66fc83af.zip
cpython-522785732f09b0be6d4bc06a2782ecda66fc83af.tar.gz
cpython-522785732f09b0be6d4bc06a2782ecda66fc83af.tar.bz2
[Patch #1617413 from Dug Song] Fix HTTP Basic authentication via HTTPS
-rw-r--r--Lib/urllib.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py
index 064632c..4a1fa64 100644
--- a/Lib/urllib.py
+++ b/Lib/urllib.py
@@ -405,8 +405,8 @@ class URLopener:
h.putheader('Content-Length', '%d' % len(data))
else:
h.putrequest('GET', selector)
- if proxy_auth: h.putheader('Proxy-Authorization: Basic %s' % proxy_auth)
- if auth: h.putheader('Authorization: Basic %s' % auth)
+ if proxy_auth: h.putheader('Proxy-Authorization', 'Basic %s' % proxy_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()