diff options
| author | Burt Holzman <burt@fnal.gov> | 2013-01-24 00:24:09 -0600 |
|---|---|---|
| committer | Burt Holzman <burt@fnal.gov> | 2013-01-24 17:11:10 -0600 |
| commit | dfec46ac8e4cba23da842698c2bc746c03994afe (patch) | |
| tree | 96209b11f99fd93835f6952d8aae40b6ee081eaa /nova/tests | |
| parent | 33680e6b2d2026ae8394579586f02d9773649674 (diff) | |
Increase maximum URI size for EC2 API to 16k
The EC2 API supports both HTTP GET and POST agnostically. It also supports
user-data of 16k -- meaning that client tools could generate 16k URIs.
The WSGI default limit is 8k; this raises it.
Fixes bug 1098646.
Change-Id: Idec460d88b2affab970c9d9f39fa61295db035c5
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/test_wsgi.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/nova/tests/test_wsgi.py b/nova/tests/test_wsgi.py index b04bc3e03..cd64688a2 100644 --- a/nova/tests/test_wsgi.py +++ b/nova/tests/test_wsgi.py @@ -22,6 +22,8 @@ import os.path import tempfile import eventlet +import httplib2 +import paste import nova.exception from nova import test @@ -108,6 +110,25 @@ class TestWSGIServer(test.TestCase): server.stop() server.wait() + def test_uri_length_limit(self): + server = nova.wsgi.Server("test_uri_length_limit", None, + host="127.0.0.1", max_url_len=16384) + server.start() + + uri = "http://127.0.0.1:%d/%s" % (server.port, 10000 * 'x') + resp, _ = httplib2.Http().request(uri) + eventlet.sleep(0) + self.assertNotEqual(resp.status, + paste.httpexceptions.HTTPRequestURITooLong.code) + + uri = "http://127.0.0.1:%d/%s" % (server.port, 20000 * 'x') + resp, _ = httplib2.Http().request(uri) + eventlet.sleep(0) + self.assertEqual(resp.status, + paste.httpexceptions.HTTPRequestURITooLong.code) + server.stop() + server.wait() + class TestWSGIServerWithSSL(test.TestCase): """WSGI server with SSL tests.""" |
