← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1623517] Re: A PUT or POST sent to placement API without a content-type header will result in a 500, should be a 400

 

Reviewed:  https://review.openstack.org/370154
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=281a78e0af3819e7de3ed84ddb83ec93ac0cc281
Submitter: Jenkins
Branch:    master

commit 281a78e0af3819e7de3ed84ddb83ec93ac0cc281
Author: Chris Dent <cdent@xxxxxxxxxxxxx>
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.
    
    Change-Id: I6e7dffb5dc5f0cdc78a57e8df3ae9952c55163ae
    Closes-Bug: #1623517


** 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).
https://bugs.launchpad.net/bugs/1623517

Title:
  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):
  Fix Released

Bug description:
  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:
https://bugs.launchpad.net/nova/+bug/1623517/+subscriptions


References