[openstack-dev] [nova][cinder][glance] What should be the response for invalid 'Accpet' header?

Singh, Niraj niraj.singh at nttdata.com
Fri Sep 1 05:09:02 UTC 2017


Hi Sean,

As per your suggestion, I have reported a bug in Launchpad.
Please refer, https://bugs.launchpad.net/masakari/+bug/1714416

Thank you,

Niraj

From: Sean McGinnis [mailto:sean.mcginnis at gmx.com]
Sent: 31 August 2017 20:47
To: openstack-dev at lists.openstack.org
Subject: Re: [openstack-dev] [nova][cinder][glance] What should be the response for invalid 'Accpet' header?


Hey Niraj,

That does seem to be incorrect behavior on the services side. It would be good to have a bug
filed to track it. For now you could open one and flag each project as being affected. We may
find that it requires a change in each project, or it may end up being a common oslo change.
Either way, a bug will allow us to capture findings and make sure it gets resolved.

https://bugs.launchpad.net/cinder/+filebug

Thanks,

Sean

On 08/31/2017 05:10 AM, Singh, Niraj wrote:
Hi Devs,

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.

I have checked this behavior for nova, cinder and glance and for all of these it is returning HTTP 200 OK which is invalid.
Please let me know your opinion for the same.

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


Thank you,
Niraj Singh


______________________________________________________________________
Disclaimer: This email and any attachments are sent in strictest confidence
for the sole use of the addressee and may contain legally privileged,
confidential, and proprietary data. If you are not the intended recipient,
please advise the sender by replying promptly to this email and then delete
and destroy this email and any attachments without any further use, copying
or forwarding.




__________________________________________________________________________

OpenStack Development Mailing List (not for usage questions)

Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe<mailto:OpenStack-dev-request at lists.openstack.org?subject:unsubscribe>

http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


______________________________________________________________________
Disclaimer: This email and any attachments are sent in strictest confidence
for the sole use of the addressee and may contain legally privileged,
confidential, and proprietary data. If you are not the intended recipient,
please advise the sender by replying promptly to this email and then delete
and destroy this email and any attachments without any further use, copying
or forwarding.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20170901/08f5e9af/attachment.html>


More information about the OpenStack-dev mailing list