diff options
Diffstat (limited to 'Lib/urllib2.py')
-rw-r--r-- | Lib/urllib2.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/urllib2.py b/Lib/urllib2.py index 3ad0b15..91c632c 100644 --- a/Lib/urllib2.py +++ b/Lib/urllib2.py @@ -531,8 +531,11 @@ class HTTPRedirectHandler(BaseHandler): # do the same. # be conciliant with URIs containing a space newurl = newurl.replace(' ', '%20') + newheaders = dict((k,v) for k,v in req.headers.items() + if k.lower() not in ("content-length", "content-type") + ) return Request(newurl, - headers=req.headers, + headers=newheaders, origin_req_host=req.get_origin_req_host(), unverifiable=True) else: |