summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_wsgiref.py
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2014-09-17 08:29:29 (GMT)
committerSenthil Kumaran <senthil@uthcode.com>2014-09-17 08:29:29 (GMT)
commite025b52db0651081eb08978efa850269c8282073 (patch)
treeb7d3c25d7f1a48f0476a9f1465212007467f542f /Lib/test/test_wsgiref.py
parent2a42a0bff36129fc9aec06b20e67747cfcc85230 (diff)
downloadcpython-e025b52db0651081eb08978efa850269c8282073.zip
cpython-e025b52db0651081eb08978efa850269c8282073.tar.gz
cpython-e025b52db0651081eb08978efa850269c8282073.tar.bz2
Issue #22419: Limit the length of incoming HTTP request in wsgiref server to 65536 bytes.
Diffstat (limited to 'Lib/test/test_wsgiref.py')
-rw-r--r--Lib/test/test_wsgiref.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_wsgiref.py b/Lib/test/test_wsgiref.py
index 901f3c9..e213d77 100644
--- a/Lib/test/test_wsgiref.py
+++ b/Lib/test/test_wsgiref.py
@@ -118,6 +118,11 @@ class IntegrationTests(TestCase):
out, err = run_amock()
self.check_hello(out)
+ def test_request_length(self):
+ out, err = run_amock(data=b"GET " + (b"x" * 65537) + b" HTTP/1.0\n\n")
+ self.assertEqual(out.splitlines()[0],
+ b"HTTP/1.0 414 Request-URI Too Long")
+
def test_validated_hello(self):
out, err = run_amock(validator(hello_app))
# the middleware doesn't support len(), so content-length isn't there