summaryrefslogtreecommitdiffstats
path: root/Lib/urllib/request.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/urllib/request.py')
-rw-r--r--Lib/urllib/request.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index c638cfa5..464f847 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -1063,8 +1063,10 @@ class AbstractHTTPHandler(BaseHandler):
raise URLError('no host given')
h = http_class(host, timeout=req.timeout) # will parse host:port
- 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))
# TODO(jhylton): Should this be redesigned to handle
# persistent connections?