From 1ecc7386da17df3f1dfd100845355f7211119a62 Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Sun, 25 Oct 2015 13:52:25 -0400 Subject: [PATCH] Make "headers too large" test understand 431 response code. --- tornado/test/httpserver_test.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 -- 2.47.3