From: Ben Darnell Date: Sun, 25 Oct 2015 17:52:25 +0000 (-0400) Subject: Make "headers too large" test understand 431 response code. X-Git-Tag: v4.3.0~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ecc7386da17df3f1dfd100845355f7211119a62;p=thirdparty%2Ftornado.git Make "headers too large" test understand 431 response code. --- diff --git a/tornado/test/httpserver_test.py b/tornado/test/httpserver_test.py index 859d817d0..065f5b1fa 100644 --- a/tornado/test/httpserver_test.py +++ b/tornado/test/httpserver_test.py @@ -899,9 +899,12 @@ class MaxHeaderSizeTest(AsyncHTTPTestCase): self.assertEqual(response.body, b"Hello world") def test_large_headers(self): - with ExpectLog(gen_log, "Unsatisfiable read"): + with ExpectLog(gen_log, "Unsatisfiable read", required=False): response = self.fetch("/", headers={'X-Filler': 'a' * 1000}) - self.assertEqual(response.code, 599) + # 431 is "Request Header Fields Too Large", defined in RFC + # 6585. However, many implementations just close the + # connection in this case, resulting in a 599. + self.assertIn(response.code, (431, 599)) @skipOnTravis