revision 1.25 of urllib2.py
Fix bug #511786 (2.2.1 candidate): ensure that custom-supplied headers
are preserved for redirected requests.
# 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 \