mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #26586: Merge excessive HTTP header handling from 3.5
This commit is contained in:
commit
b93e4b2480
3 changed files with 18 additions and 0 deletions
|
@ -859,6 +859,13 @@ class BaseHTTPRequestHandlerTestCase(unittest.TestCase):
|
|||
self.assertFalse(self.handler.get_called)
|
||||
self.assertEqual(self.handler.requestline, 'GET / HTTP/1.1')
|
||||
|
||||
def test_too_many_headers(self):
|
||||
result = self.send_typical_request(
|
||||
b'GET / HTTP/1.1\r\n' + b'X-Foo: bar\r\n' * 101 + b'\r\n')
|
||||
self.assertEqual(result[0], b'HTTP/1.1 431 Too many headers\r\n')
|
||||
self.assertFalse(self.handler.get_called)
|
||||
self.assertEqual(self.handler.requestline, 'GET / HTTP/1.1')
|
||||
|
||||
def test_close_connection(self):
|
||||
# handle_one_request() should be repeatedly called until
|
||||
# it sets close_connection
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue