Author: Chris Dent <cd...@anticdent.org>
Date: Wed Sep 14 15:18:30 2016 +0100
[placement] prevent a KeyError in webob.dec.wsgify
If a PUT, POST or PATCH is sent without a content-type header,
webob.dec.wsgify will raise a KeyError. Avoid this by checking for
the content-type header before reaching any wsgify calls. As noted
in the TODO within this is not the most elegant solution, but
prevents an inadvertent 500 and returns a reasonable 400.
** Changed in: nova
Status: In Progress => Fix Released
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
A PUT or POST sent to placement API without a content-type header will
result in a 500, should be a 400
Status in OpenStack Compute (nova):
If, by some twist of fate, a user agent send a PUT or POST requests to
the placement API without a content-type header, the service will have
an uncaught KeyError exception raised in webob as it tries to parse
the body of the request. Tests which thought they were testing for
this were not. The webob.dec.wsgify decorator is doing some work
before the thing which the test exercises gets involved. So further
tests and guards are required to avoid the 500.
To manage notifications about this bug go to:
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to : firstname.lastname@example.org
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help : https://help.launchpad.net/ListHelp