Commit 48b2be2c authored by Vincent Pelletier's avatar Vincent Pelletier

fixup! http_wsgibase, wsgi: Move request transfer encoding handling out of wsgi.

parent b5be8762
......@@ -1327,43 +1327,6 @@ class CaucaseTest(unittest.TestCase):
'CONTENT_TYPE': 'application/json',
'wsgi.input': StringIO('{"digest":"sha256","payload":""}'),
})[0], 400)
self.assertEqual(request({
'PATH_INFO': '/cau/crt/revoke',
'REQUEST_METHOD': 'PUT',
'CONTENT_TYPE': 'application/json',
'HTTP_TRANSFER_ENCODING': 'chunked',
'wsgi.input': StringIO(
'a\r\n' # lower-case hex
'{"digest":\r\n'
'5 extension must be ignored\r\n'
'null,\r\n'
'A\r\n' # upper-case hex
'"foo":"a",\r\n'
'f\r\n'
'"payload":"{}"}\r\n'
'0\r\n'
'tail must also be ignored\r\n',
),
})[0], UNAUTHORISED_STATUS)
self.assertEqual(request({
'PATH_INFO': '/cau/crt/revoke',
'REQUEST_METHOD': 'PUT',
'CONTENT_TYPE': 'application/json',
'HTTP_TRANSFER_ENCODING': 'chunked',
'wsgi.input': StringIO(
'%x\r\n' % (wsgi.MAX_BODY_LENGTH + 1, ),
),
})[0], 413)
self.assertEqual(request({
'PATH_INFO': '/cau/crt/revoke',
'REQUEST_METHOD': 'PUT',
'CONTENT_TYPE': 'application/json',
'HTTP_TRANSFER_ENCODING': 'chunked',
'wsgi.input': StringIO(
'a\r\n'
'{"digest":\r\r' # bad separator
),
})[0], 400)
self.assertEqual(request({
'PATH_INFO': '/cau/crt/a',
'REQUEST_METHOD': 'PUT',
......
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