summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Waldon <brian.waldon@rackspace.com>2011-07-08 17:21:58 -0400
committerBrian Waldon <brian.waldon@rackspace.com>2011-07-08 17:21:58 -0400
commitfe8da67779dbb03654b1cce90eeafdb323507673 (patch)
tree518e7f4c5e48c6271a2800411edb03c88e1eca03
parent32a3cf25721173014fbd20c8f2954f015316f439 (diff)
downloadnova-fe8da67779dbb03654b1cce90eeafdb323507673.tar.gz
nova-fe8da67779dbb03654b1cce90eeafdb323507673.tar.xz
nova-fe8da67779dbb03654b1cce90eeafdb323507673.zip
easing up content-type restrictions
-rw-r--r--nova/api/openstack/wsgi.py2
-rw-r--r--nova/tests/api/openstack/test_wsgi.py3
2 files changed, 2 insertions, 3 deletions
diff --git a/nova/api/openstack/wsgi.py b/nova/api/openstack/wsgi.py
index 1a33b7744..bd91aed60 100644
--- a/nova/api/openstack/wsgi.py
+++ b/nova/api/openstack/wsgi.py
@@ -52,7 +52,7 @@ class Request(webob.Request):
content_type = self.content_type
if content_type not in allowed_types:
- raise exception.InvalidContentType(content_type=content_type)
+ return None
else:
return content_type
diff --git a/nova/tests/api/openstack/test_wsgi.py b/nova/tests/api/openstack/test_wsgi.py
index 938637207..7ab39ed5a 100644
--- a/nova/tests/api/openstack/test_wsgi.py
+++ b/nova/tests/api/openstack/test_wsgi.py
@@ -18,8 +18,7 @@ class RequestTest(test.TestCase):
request = wsgi.Request.blank('/tests/123', method='POST')
request.headers["Content-Type"] = "text/html"
request.body = "asdf<br />"
- self.assertRaises(exception.InvalidContentType,
- request.get_content_type)
+ self.assertEqual(request.get_content_type(), None)
def test_content_type_with_charset(self):
request = wsgi.Request.blank('/tests/123')