diff options
Diffstat (limited to 'test/test_environ.py')
-rwxr-xr-x | test/test_environ.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test_environ.py b/test/test_environ.py index 517048d..b693e83 100755 --- a/test/test_environ.py +++ b/test/test_environ.py @@ -385,6 +385,15 @@ class TestRequest(unittest.TestCase): e['CONTENT_LENGTH'] = str(len(json_dumps(test))) self.assertEqual(BaseRequest(e).json, test) + def test_json_forged_header_issue616(self): + test = dict(a=5, b='test', c=[1,2,3]) + e = {'CONTENT_TYPE': 'text/plain;application/json'} + wsgiref.util.setup_testing_defaults(e) + e['wsgi.input'].write(tob(json_dumps(test))) + e['wsgi.input'].seek(0) + e['CONTENT_LENGTH'] = str(len(json_dumps(test))) + self.assertEqual(BaseRequest(e).json, None) + def test_isajax(self): e = {} wsgiref.util.setup_testing_defaults(e) |