From: MinRK Date: Sun, 22 Dec 2013 06:29:40 +0000 (-0800) Subject: test that invalid unicode doesn't raise 500 X-Git-Tag: v3.2.0b1~20^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c0f4257d1dc5ecc53abe98c7499422c6cf7b052;p=thirdparty%2Ftornado.git test that invalid unicode doesn't raise 500 --- diff --git a/tornado/test/web_test.py b/tornado/test/web_test.py index 6136172fc..f4fa03a66 100644 --- a/tornado/test/web_test.py +++ b/tornado/test/web_test.py @@ -586,6 +586,13 @@ class WSGISafeWebTest(WebTestCase): u('query'): [u('bytes'), u('c3a9')], }) + def test_decode_argument_invalid_unicode(self): + # test that invalid unicode in URLs causes 400, not 500 + response = self.fetch("/typecheck/invalid%FF") + self.assertEqual(response.code, 400) + response = self.fetch("/typecheck/invalid?foo=%FF") + self.assertEqual(response.code, 400) + def test_decode_argument_plus(self): # These urls are all equivalent. urls = ["/decode_arg/1%20%2B%201?foo=1%20%2B%201&encoding=utf-8",