diff options
author | Brandon Irizarry <iz.brandon@yahoo.com> | 2016-04-13 05:18:25 +0000 |
---|---|---|
committer | Brandon Irizarry <iz.brandon@yahoo.com> | 2016-04-15 01:38:48 +0000 |
commit | a7019a87ba696509d825c6c6f2220331e4ffb033 (patch) | |
tree | 430c7a7e1e27418dc4aee9083180633706c9949d /nova/api/openstack/wsgi.py | |
parent | 44db7db0a89bf31b7d347d84f1f1f879d07494bb (diff) | |
download | nova-a7019a87ba696509d825c6c6f2220331e4ffb033.tar.gz |
Changed an HTTP exception to return proper code
POSTing to /servers with a content-type of text/plain
and a text/plain body results in a response code of 400.
It should be 415. I found this line in the code that
appears to handle this singular case and modified
the HTTP exception used to the correct one. Tests were
also updated accordingly.
Change-Id: I5fa1fdba56803b2ef63b1efaaeeced6ceb7779d9
Closes-Bug: 1567977
Diffstat (limited to 'nova/api/openstack/wsgi.py')
-rw-r--r-- | nova/api/openstack/wsgi.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/nova/api/openstack/wsgi.py b/nova/api/openstack/wsgi.py index 37d2836498..01d2feb185 100644 --- a/nova/api/openstack/wsgi.py +++ b/nova/api/openstack/wsgi.py @@ -661,7 +661,7 @@ class Resource(wsgi.Application): accept = request.best_match_content_type() except exception.InvalidContentType: msg = _("Unsupported Content-Type") - return Fault(webob.exc.HTTPBadRequest(explanation=msg)) + return Fault(webob.exc.HTTPUnsupportedMediaType(explanation=msg)) # NOTE(Vek): Splitting the function up this way allows for # auditing by external tools that wrap the existing |