Commit d0641640 authored by Chris McDonough's avatar Chris McDonough

Revert changes made in revision 65541 in favor of moving them to the...

Revert changes made in revision 65541 in favor of moving them to the blob-integration-test branch for eventual merge. 
parent d513ab65
...@@ -26,10 +26,6 @@ Zope Changes ...@@ -26,10 +26,6 @@ Zope Changes
Restructuring Restructuring
- REQUEST.processInputs now shortcuts the creation of a cgi.FieldStorage
object if the request is a PUT request. This is an optimization
for large uploads.
- deprecated the zLOG module. Use Pythons 'logging' module instead. - deprecated the zLOG module. Use Pythons 'logging' module instead.
- replaced all zLOG occurences (expect the zLOG module itself) with - replaced all zLOG occurences (expect the zLOG module itself) with
......
...@@ -375,15 +375,6 @@ class HTTPRequest(BaseRequest): ...@@ -375,15 +375,6 @@ class HTTPRequest(BaseRequest):
environ=self.environ environ=self.environ
method=environ.get('REQUEST_METHOD','GET') method=environ.get('REQUEST_METHOD','GET')
if method == 'PUT':
# we don't need to do any real input processing if we are handling
# a PUT request because in practice, the body is never
# mime-encoded. This is an optimization especially because
# FieldStorage creates an additional tempfile if we allow it to
# parse the body, and PUT uploads can tend to be large.
self._file = self.stdin
return
if method != 'GET': fp=self.stdin if method != 'GET': fp=self.stdin
else: fp=None else: fp=None
......
...@@ -14,11 +14,11 @@ class RecordTests( unittest.TestCase ): ...@@ -14,11 +14,11 @@ class RecordTests( unittest.TestCase ):
class ProcessInputsTests(unittest.TestCase): class ProcessInputsTests(unittest.TestCase):
def _getHTTPRequest(self, env, stdin=None): def _getHTTPRequest(self, env):
from ZPublisher.HTTPRequest import HTTPRequest from ZPublisher.HTTPRequest import HTTPRequest
return HTTPRequest(stdin, env, None) return HTTPRequest(None, env, None)
def _processInputs(self, inputs, extraenv=None, stdin=None): def _processInputs(self, inputs):
# Have the inputs processed, and return a HTTPRequest object holding the # Have the inputs processed, and return a HTTPRequest object holding the
# result. # result.
# inputs is expected to be a list of (key, value) tuples, no CGI # inputs is expected to be a list of (key, value) tuples, no CGI
...@@ -32,9 +32,7 @@ class ProcessInputsTests(unittest.TestCase): ...@@ -32,9 +32,7 @@ class ProcessInputsTests(unittest.TestCase):
env = {'SERVER_NAME': 'testingharnas', 'SERVER_PORT': '80'} env = {'SERVER_NAME': 'testingharnas', 'SERVER_PORT': '80'}
env['QUERY_STRING'] = query_string env['QUERY_STRING'] = query_string
if extraenv is not None: req = self._getHTTPRequest(env)
env.update(extraenv)
req = self._getHTTPRequest(env, stdin)
req.processInputs() req.processInputs()
self._noFormValuesInOther(req) self._noFormValuesInOther(req)
return req return req
...@@ -156,15 +154,6 @@ class ProcessInputsTests(unittest.TestCase): ...@@ -156,15 +154,6 @@ class ProcessInputsTests(unittest.TestCase):
self._noTaintedValues(req) self._noTaintedValues(req)
self._onlyTaintedformHoldsTaintedStrings(req) self._onlyTaintedformHoldsTaintedStrings(req)
def testPUTShortcut(self):
# PUT requests are not fed through cgi.FieldStorage because
# their bodies are never (in practice, anyway) MIME-encoded, and
# we don't want FieldStorage to create a separate tempfile copy for
# large uploads.
stdin = []
req = self._processInputs((), {'REQUEST_METHOD':'PUT'}, stdin)
self.assert_(req._file is stdin)
def testUnicodeConversions(self): def testUnicodeConversions(self):
inputs = (('ustring:ustring:utf8', 'test\xc2\xae'), inputs = (('ustring:ustring:utf8', 'test\xc2\xae'),
('utext:utext:utf8', 'test\xc2\xae\ntest\xc2\xae\n'), ('utext:utext:utf8', 'test\xc2\xae\ntest\xc2\xae\n'),
......
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