From dfec46ac8e4cba23da842698c2bc746c03994afe Mon Sep 17 00:00:00 2001 From: Burt Holzman Date: Thu, 24 Jan 2013 00:24:09 -0600 Subject: 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 --- nova/tests/test_wsgi.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'nova/tests') 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.""" -- cgit