Commit d5c04bcb authored by Hanno Schlichting's avatar Hanno Schlichting

Applied patch from https://bugs.launchpad.net/zope2/+bug/257675, avoiding the...

Applied patch from https://bugs.launchpad.net/zope2/+bug/257675, avoiding the mysterious '-C' in request.form
parent f72be803
...@@ -478,6 +478,12 @@ class HTTPRequest(BaseRequest): ...@@ -478,6 +478,12 @@ class HTTPRequest(BaseRequest):
other = self.other other = self.other
taintedform = self.taintedform taintedform = self.taintedform
# If 'QUERY_STRING' is not present in environ
# FieldStorage will try to get it from sys.argv[1]
# which is not what we need.
if not environ.has_key('QUERY_STRING'):
environ['QUERY_STRING'] = ''
meth = None meth = None
fs = ZopeFieldStorage(fp=fp,environ=environ,keep_blank_values=1) fs = ZopeFieldStorage(fp=fp,environ=environ,keep_blank_values=1)
if not hasattr(fs,'list') or fs.list is None: if not hasattr(fs,'list') or fs.list is None:
......
...@@ -128,6 +128,13 @@ class HTTPRequestTests(unittest.TestCase): ...@@ -128,6 +128,13 @@ class HTTPRequestTests(unittest.TestCase):
"Key %s not correctly reproduced in tainted; expected %r, " "Key %s not correctly reproduced in tainted; expected %r, "
"got %r" % (key, req.form[key], req.taintedform[key])) "got %r" % (key, req.form[key], req.taintedform[key]))
def test_processInputs_wo_query_string(self):
env = {'SERVER_NAME': 'testingharnas', 'SERVER_PORT': '80'}
req = self._makeOne(environ=env)
req.processInputs()
self._noFormValuesInOther(req)
self.assertEquals(req.form, {})
def test_processInputs_wo_marshalling(self): def test_processInputs_wo_marshalling(self):
inputs = ( inputs = (
('foo', 'bar'), ('spam', 'eggs'), ('foo', 'bar'), ('spam', 'eggs'),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment