[issue14144] urllib2 HTTPRedirectHandler not forwarding POST data in redirect

Éric Araujo report at bugs.python.org
Sat Mar 3 12:44:54 CET 2012


Éric Araujo <merwok at netwok.org> added the comment:

> However, an added option which leaves the current behavior as the default shouldn't hurt.
My opinion too.  urllib is sometimes a client, sometimes a library used to build clients, which need a knob to implement their own decisions or possibly ask the user for confirmation.

A new argument being a new feature, this patch must target 3.3.

Some comments on the patch:

+    # NOTE: Setting redirect_post_data to True *can* introduce security
+    # issues and is not recommended unless you are sure of where the 
+    # POST data is being redirected!
I would tone down this note, for example:

     # setting redirect_post_data to True can introduce security
     # issues, use with caution

+    redirect_post_data = False
Is an attribute okay or should methods (__init__, maybe methods that do the requests too) grow a new parameter?

----------
stage:  -> patch review
type: behavior -> enhancement
versions: +Python 3.3 -Python 2.7

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


More information about the Python-bugs-list mailing list