summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2006-12-19 15:12:23 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2006-12-19 15:12:23 (GMT)
commit0faf90acc43484c934e816bb675bca0007d31c17 (patch)
tree7a195f420caa24833e89301a0f55f3e8f79ecc10
parente6acc8718c863de31349ce7213e3bc76b81f4d32 (diff)
downloadcpython-0faf90acc43484c934e816bb675bca0007d31c17.zip
cpython-0faf90acc43484c934e816bb675bca0007d31c17.tar.gz
cpython-0faf90acc43484c934e816bb675bca0007d31c17.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()