List servers with a request body should return 400 Bad Request

Bug #1160982 reported by Alex Meade
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Won't Fix
Low
git-harry

Bug Description

A GET /servers/detail request containing a body does not return a BadRequest.

Request:
curl -i http://176.78.165.15:8774/v2/339822f0d748407fb69b678cc80c2496/servers/detail -X GET -H "X-Auth-Project-Id: demo" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: MIIKpAYJKoZIhZw==" -d "{}"

Response:
{"servers": []}

Since nova would not use a request body in this case it should give a bad request.

Chuck Short (zulcss)
Changed in nova:
status: New → Triaged
Revision history for this message
Luke Wollney (luke-wollney) wrote :

There is a similar bug for a GET /servers/<server_id>.

It should return a 400 Bad Request as well.

Revision history for this message
Luke Wollney (luke-wollney) wrote :

This appears to have been fixed for the GET /server/detail request, but it still appears to be an issue for the GET/servers/<server_id>

git-harry (git-harry)
Changed in nova:
assignee: nobody → git-harry (git-harry)
Revision history for this message
git-harry (git-harry) wrote :

This issue still appears to be present.

Currently content-type and body get set to None and '' respectively if one or both don't meet nova's requirements. This means the body is ignored and the request is processed as if it was never sent.

If a content-type of application/json is specified when the data is sent a 400 bad request response is returned.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/29061

Changed in nova:
status: Triaged → In Progress
Revision history for this message
Joe Gordon (jogo) wrote :

closing bug as per discussion on patch

Changed in nova:
status: In Progress → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.