diff options
author | Senthil Kumaran <orsenthil@gmail.com> | 2010-12-18 16:55:23 +0000 |
---|---|---|
committer | Senthil Kumaran <orsenthil@gmail.com> | 2010-12-18 16:55:23 +0000 |
commit | 5466bf1c94d38e75bc053b0cfc163e2f948fe345 (patch) | |
tree | ee76b8a66c739f7b7d2b6cb747f1bf7cbd5181d6 /Lib/test/test_httpservers.py | |
parent | 32e1771daf0ebbde326d91dede4b9cfae6e74f27 (diff) | |
download | cpython-git-5466bf1c94d38e75bc053b0cfc163e2f948fe345.tar.gz |
Fix Issue6791 - Limit the HTTP header readline with _MAXLENGTH. Patch by Antoine Pitrou
Diffstat (limited to 'Lib/test/test_httpservers.py')
-rw-r--r-- | Lib/test/test_httpservers.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py index 85b5ec496d..19d3d17638 100644 --- a/Lib/test/test_httpservers.py +++ b/Lib/test/test_httpservers.py @@ -573,6 +573,13 @@ class BaseHTTPRequestHandlerTestCase(unittest.TestCase): self.assertEqual(result[0], b'HTTP/1.1 414 Request-URI Too Long\r\n') self.assertFalse(self.handler.get_called) + def test_header_length(self): + # Issue #6791: same for headers + result = self.send_typical_request( + b'GET / HTTP/1.1\r\nX-Foo: bar' + b'r' * 65537 + b'\r\n\r\n') + self.assertEqual(result[0], b'HTTP/1.1 400 Line too long\r\n') + self.assertFalse(self.handler.get_called) + class SimpleHTTPRequestHandlerTestCase(unittest.TestCase): """ Test url parsing """ def setUp(self): |