changeset 3209:799875c9fe2d

when setting up the request.form dict, make all request methods consistently use keep_blank_values=1 (see cgi.FieldStorage)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 07 Mar 2008 02:03:19 +0100
parents 4f6d7765e1f5
children b6edaabd06b7
files MoinMoin/request/request_cgi.py MoinMoin/request/request_fcgi.py MoinMoin/request/request_modpython.py MoinMoin/request/request_standalone.py MoinMoin/request/request_twisted.py
diffstat 5 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/request/request_cgi.py	Fri Mar 07 01:28:34 2008 +0100
+++ b/MoinMoin/request/request_cgi.py	Fri Mar 07 02:03:19 2008 +0100
@@ -30,7 +30,7 @@
 
     def _setup_args_from_cgi_form(self):
         """ Override to create cgi form """
-        form = cgi.FieldStorage()
+        form = cgi.FieldStorage(keep_blank_values=1)
         return RequestBase._setup_args_from_cgi_form(self, form)
 
     def read(self, n=None):
--- a/MoinMoin/request/request_fcgi.py	Fri Mar 07 01:28:34 2008 +0100
+++ b/MoinMoin/request/request_fcgi.py	Fri Mar 07 02:03:19 2008 +0100
@@ -32,6 +32,7 @@
 
     def _setup_args_from_cgi_form(self):
         """ Override to use FastCGI form """
+        # thfcgi used keep_blank_values=1 internally for fcgform
         return RequestBase._setup_args_from_cgi_form(self, self.fcgform)
 
     def read(self, n=None):
--- a/MoinMoin/request/request_modpython.py	Fri Mar 07 01:28:34 2008 +0100
+++ b/MoinMoin/request/request_modpython.py	Fri Mar 07 02:03:19 2008 +0100
@@ -81,7 +81,7 @@
         duplicate the conversion code.
         """
         from mod_python import util
-        form = util.FieldStorage(self.mpyreq)
+        form = util.FieldStorage(self.mpyreq, keep_blank_values=1) # by default this evaluates query string AND body POST data!
 
         args = {}
 
--- a/MoinMoin/request/request_standalone.py	Fri Mar 07 01:28:34 2008 +0100
+++ b/MoinMoin/request/request_standalone.py	Fri Mar 07 02:03:19 2008 +0100
@@ -57,7 +57,8 @@
 
     def _setup_args_from_cgi_form(self):
         """ Override to create standalone form """
-        form = cgi.FieldStorage(self.rfile, headers=self.headers, environ={'REQUEST_METHOD': 'POST'})
+        form = cgi.FieldStorage(self.rfile, headers=self.headers, environ={'REQUEST_METHOD': 'POST'},
+                                keep_blank_values=1)
         return RequestBase._setup_args_from_cgi_form(self, form)
 
     def read(self, n=None):
--- a/MoinMoin/request/request_twisted.py	Fri Mar 07 01:28:34 2008 +0100
+++ b/MoinMoin/request/request_twisted.py	Fri Mar 07 02:03:19 2008 +0100
@@ -70,8 +70,7 @@
         Twisted already parsed args, including __filename__ hacking,
         but did not decode the values.
         """
-        # TODO: check if for a POST this included query_string args (needed for
-        # TwikiDraw's action=AttachFile&do=savedrawing)
+        # All of the arguments, including URL and POST arguments (using keep_blank_values=1 internally).
         return self.decodeArgs(self.twistd.args)
 
     def read(self, n=None):