[openstack-dev] [nova][cinder][glance] What should be the response for invalid 'Accpet' header?
cdent+os at anticdent.org
Fri Sep 1 17:53:56 UTC 2017
On Fri, 1 Sep 2017, Sean McGinnis wrote:
> Thanks Chris, I wasn't aware of that. What's your opinion - change
> it to be more strict, or leave it as is?
Ideally we'd have true content negotiation and support multiple
representations with different content types and diferent versions.
But since we don't I think existing services can probably forgo
making any changes unless they are eager to tighten things up.
For some additional context:
Placement vaguely supports content negotiation but not in any
significant way. The docstring of a check_accept decorator says:
"If accept is set explicitly, try to follow it. If there is no match
for the incoming accept header send a 406 response code. If accept
is not set send our usual content-type in response."
Because of the way placement uses webob, and the way webob uses the
accept header to control the formatting of error responses then
content negotiation comes into play on error responses: They are
text/html unless there is an accept header of application/json.
Chris Dent (⊙＿⊙') https://anticdent.org/
freenode: cdent tw: @anticdent
More information about the OpenStack-dev