summaryrefslogtreecommitdiffstats
path: root/Lib/urllib2.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/urllib2.py')
-rw-r--r--Lib/urllib2.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/urllib2.py b/Lib/urllib2.py
index 5c717a4..adc6d8c 100644
--- a/Lib/urllib2.py
+++ b/Lib/urllib2.py
@@ -1127,8 +1127,10 @@ class AbstractHTTPHandler(BaseHandler):
h = http_class(host, timeout=req.timeout) # will parse host:port
h.set_debuglevel(self._debuglevel)
- headers = dict(req.headers)
- headers.update(req.unredirected_hdrs)
+ headers = dict(req.unredirected_hdrs)
+ headers.update(dict((k, v) for k, v in req.headers.items()
+ if k not in headers))
+
# We want to make an HTTP/1.1 request, but the addinfourl
# class isn't prepared to deal with a persistent connection.
# It will try to read all remaining data from the socket,