diff options
author | Senthil Kumaran <senthil@uthcode.com> | 2014-09-17 08:32:46 (GMT) |
---|---|---|
committer | Senthil Kumaran <senthil@uthcode.com> | 2014-09-17 08:32:46 (GMT) |
commit | dc41440401b7c66271bf03c80aada942422a38bb (patch) | |
tree | 67d88188f38fc09e2458c5a18604355730cb9940 /Lib/test | |
parent | 810dc9bc81e83b6f31d10fd9e92a9f4f79f72b5d (diff) | |
parent | 86c9e1877cc287b602e06f3627cda2d81cbd176a (diff) | |
download | cpython-dc41440401b7c66271bf03c80aada942422a38bb.zip cpython-dc41440401b7c66271bf03c80aada942422a38bb.tar.gz cpython-dc41440401b7c66271bf03c80aada942422a38bb.tar.bz2 |
Merge from 3.4
Issue #22419: Limit the length of incoming HTTP request in wsgiref server to 65536 bytes.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_wsgiref.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_wsgiref.py b/Lib/test/test_wsgiref.py index 190f3ba..479fcbc 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 |