[issue14144] urllib2 HTTPRedirectHandler not forwarding POST data in redirect

Jay Deiman report at bugs.python.org
Fri Mar 2 20:18:54 CET 2012


Jay Deiman <admin at splitstreams.com> added the comment:

Senthil,

The HTTPRedirectHandler is already breaking RFC2616 by it's own admission in the code comments (from the source):

# Strictly (according to RFC 2616), 301 or 302 in response
# to a POST MUST NOT cause a redirection without confirmation
# from the user (of urllib2, in this case).  In practice,
# essentially all clients do redirect in this case, so we
# do the same.
# be conciliant with URIs containing a space

I can definitely understand the issue with changing the default behavior to redirect the POST data.  However, an added option which leaves the current behavior as the default shouldn't hurt.  I'm submitting a new patch file (urllib2.py.redirect_option.patch), which will do exactly that.

----------
Added file: http://bugs.python.org/file24711/urllib2.py.redirect_option.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14144>
_______________________________________


More information about the Python-bugs-list mailing list