From fe8da67779dbb03654b1cce90eeafdb323507673 Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Fri, 8 Jul 2011 17:21:58 -0400 Subject: easing up content-type restrictions --- nova/api/openstack/wsgi.py | 2 +- nova/tests/api/openstack/test_wsgi.py | 3 +-- 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
" - 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') -- cgit