POST /servers with incorrect content-type returns 400, should be 415
Bug #1567977 reported by
Chris Dent
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Low
|
Brandon Iz | ||
Liberty |
Fix Released
|
Undecided
|
Ghanshyam Mann | ||
Mitaka |
Fix Released
|
Undecided
|
Matt Riedemann |
Bug Description
(master nova april 8, 2016)
POSTing to /servers with a content-type of text/plain and a text/plain body results in a response code of 400. This is incorrect. It should be 415: <https:/
Here's the gabbi demo:
- name: post bad content-type
xfail: True
POST: /servers
request_headers:
content-type: text/plain
data: I want a server so badly
status: 415
Changed in nova: | |
status: | New → Confirmed |
importance: | Undecided → Low |
tags: | added: gabbi |
Changed in nova: | |
assignee: | nobody → Brandon Iz (iz-brandon) |
To post a comment you must log in.
Presumably this is happening in part because the content type header is being ignored and the content is being treated as JSON and doesn't remotely begin to parse, spawning the 400 you'd expect then. However, there's an earlier stage of processing that should be checking the content-type.