yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #67146
[Bug 1714416] [NEW] Incorrect response returned for invalid Accept header
Public bug reported:
As of now, when user passes 'Accept' header in request other than JSON
and XML using curl command then it returns 200 OK response with json
format data.
In api-ref guide [1] also it's not clearly mentioned about what response
it should return if invalid value for 'Accept' header is specified. IMO
instead of 'HTTP 200 OK' it should return 'HTTP 406 Not Acceptable'
response.
Steps to reproduce:
Request:
curl -g -i -X GET http://controller/volume/v2/c72e66cc4f1341f381e0c2eb7b28b443/volumes/detail -H "User-Agent: python-cinderclient" -H "Accept: application/abc" -H "X-Auth-Token: cd85aff745ce4dc0a04f686b52cf7e4f"
Response:
HTTP/1.1 200 OK
Date: Thu, 31 Aug 2017 07:12:18 GMT
Server: Apache/2.4.18 (Ubuntu)
x-compute-request-id: req-ab48db9d-f869-4eb4-95f9-ef8e90a918df
Content-Type: application/json
Content-Length: 2681
x-openstack-request-id: req-ab48db9d-f869-4eb4-95f9-ef8e90a918df
Connection: close
[1] https://developer.openstack.org/api-ref/block-storage/v2/#list-volumes-with-details
** Affects: cinder
Importance: Undecided
Assignee: Niraj Singh (nirajsingh)
Status: New
** Affects: glance
Importance: Undecided
Assignee: Niraj Singh (nirajsingh)
Status: New
** Affects: heat
Importance: Undecided
Status: New
** Affects: keystone
Importance: Undecided
Status: New
** Affects: masakari
Importance: Undecided
Status: New
** Affects: neutron
Importance: Undecided
Status: New
** Affects: nova
Importance: Undecided
Status: New
** Changed in: cinder
Assignee: (unassigned) => Niraj Singh (nirajsingh)
** Also affects: glance
Importance: Undecided
Status: New
** Changed in: glance
Assignee: (unassigned) => Niraj Singh (nirajsingh)
** Also affects: nova
Importance: Undecided
Status: New
** Also affects: keystone
Importance: Undecided
Status: New
** Also affects: neutron
Importance: Undecided
Status: New
** Also affects: heat
Importance: Undecided
Status: New
** Also affects: masakari
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1714416
Title:
Incorrect response returned for invalid Accept header
Status in Cinder:
New
Status in Glance:
New
Status in OpenStack Heat:
New
Status in OpenStack Identity (keystone):
New
Status in masakari:
New
Status in neutron:
New
Status in OpenStack Compute (nova):
New
Bug description:
As of now, when user passes 'Accept' header in request other than JSON
and XML using curl command then it returns 200 OK response with json
format data.
In api-ref guide [1] also it's not clearly mentioned about what
response it should return if invalid value for 'Accept' header is
specified. IMO instead of 'HTTP 200 OK' it should return 'HTTP 406 Not
Acceptable' response.
Steps to reproduce:
Request:
curl -g -i -X GET http://controller/volume/v2/c72e66cc4f1341f381e0c2eb7b28b443/volumes/detail -H "User-Agent: python-cinderclient" -H "Accept: application/abc" -H "X-Auth-Token: cd85aff745ce4dc0a04f686b52cf7e4f"
Response:
HTTP/1.1 200 OK
Date: Thu, 31 Aug 2017 07:12:18 GMT
Server: Apache/2.4.18 (Ubuntu)
x-compute-request-id: req-ab48db9d-f869-4eb4-95f9-ef8e90a918df
Content-Type: application/json
Content-Length: 2681
x-openstack-request-id: req-ab48db9d-f869-4eb4-95f9-ef8e90a918df
Connection: close
[1] https://developer.openstack.org/api-ref/block-storage/v2/#list-volumes-with-details
To manage notifications about this bug go to:
https://bugs.launchpad.net/cinder/+bug/1714416/+subscriptions
Follow ups