Incorrect version header return incorrect error response
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Magnum |
Fix Released
|
Undecided
|
Jaycen Grant |
Bug Description
When the OpenStack-
- the version is outside the range of versions supported
- and is not the string "latest"
a `406 Not Acceptable` response should be returned, like so:
HTTP/1.1 406 Not Acceptable
Openstack-
Vary: OpenStack-
{
"errors": [
{
"code": "magnum.
{
}
]
}
]
}
This is in accordance with the new API-WG guideline [1].
However, Magnum currently returns a 500 Internal Server error. To test, execute the following:
$ curl -g -i -X GET http://
HTTP/1.0 500 Internal Server Error
Date: Wed, 13 Apr 2016 08:53:23 GMT
Server: WSGIServer/0.1 Python/2.7.6
Content-Type: text/plain
Content-Length: 59
A server error occurred. Please contact the administrator.
[1] https:/
summary: |
- Incorrect X-OpenStack-Magnum-API-Version header returns 500 not 406 + Incorrect version header return incorrect error response |
Changed in magnum: | |
status: | Incomplete → Confirmed |
@Jamie, I can not reproduce this issue:
$ curl -g -i -X GET http:// 10.238. 157.49: 9511/v1/ baymodels -H "X-OpenStack- Magnum- API-Version: 1.0" -H "X-Auth-Token: $auth_token" Magnum- API-Minimum- Version: 1.1 Magnum- API-Maximum- Version: 1.1 request- id: req-2ef79e0e- 05d5-4cad- 98ff-10b1cd122b ce
HTTP/1.0 406 Not Acceptable
Date: Thu, 14 Apr 2016 01:17:51 GMT
Server: WSGIServer/0.1 Python/2.7.6
X-OpenStack-
X-OpenStack-
Content-Type: application/json
Content-Length: 99
x-openstack-
{"errors": [{"status": 406, "code": "", "links": [], "title": "", "detail": "", "request_id": ""}]}