]> granicus.if.org Git - python/commitdiff
Fix bug #511786 (2.2.1 candidate): ensure that custom-supplied headers
authorGreg Ward <gward@python.net>
Mon, 11 Feb 2002 20:46:10 +0000 (20:46 +0000)
committerGreg Ward <gward@python.net>
Mon, 11 Feb 2002 20:46:10 +0000 (20:46 +0000)
are preserved for redirected requests.

Lib/urllib2.py

index ffd73b82ad844087bad7e5f7e37ca54dd266eafc..512d90c060449c28abb78e722c822b55a4e244b0 100644 (file)
@@ -416,7 +416,7 @@ class HTTPRedirectHandler(BaseHandler):
         # XXX Probably want to forget about the state of the current
         # request, although that might interact poorly with other
         # handlers that also use handler-specific request attributes
-        new = Request(newurl, req.get_data())
+        new = Request(newurl, req.get_data(), req.headers)
         new.error_302_dict = {}
         if hasattr(req, 'error_302_dict'):
             if len(req.error_302_dict)>10 or \