From: Michael W. Hudson Date: Fri, 22 Feb 2002 13:26:54 +0000 (+0000) Subject: backport gward's checkin of X-Git-Tag: v2.2.1c1~194 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c22d45922f899572daea762d9face789a99f1645;p=thirdparty%2FPython%2Fcpython.git backport gward's checkin of revision 1.25 of urllib2.py Fix bug #511786 (2.2.1 candidate): ensure that custom-supplied headers are preserved for redirected requests. --- diff --git a/Lib/urllib2.py b/Lib/urllib2.py index ffd73b82ad84..512d90c06044 100644 --- a/Lib/urllib2.py +++ b/Lib/urllib2.py @@ -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 \