]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Updates to OSAPI sizelimit middleware.
authorDan Prince <dprince@redhat.com>
Tue, 19 Mar 2013 23:37:47 +0000 (19:37 -0400)
committerJohn Griffith <john.griffith@solidfire.com>
Fri, 22 Mar 2013 04:04:52 +0000 (22:04 -0600)
commitd87259417c53d464dd3ec2b399faf22e65e1265c
tree1c26e4c2840f372fc5171efc58851b18f2d2a940
parent36e4e85b1f669a9fed873f4a43c783947430c763
Updates to OSAPI sizelimit middleware.

Updates the OSAPI sizelimit middleware so that we use avoid calling
len on a request body which could cause a really large request
to get buffered into memory.

Also updates the middleware to return HTTP 413 which is a more
correct error code in this case (previously it returned just 400).

Fixes LP Bug #1131857.

Change-Id: Iff6cb0c24bc21e5a1d5dd4cf29acb0b4ee221708
(cherry picked from commit 3fe81851bab39a1466d8744b372b5a287b4db93d)
cinder/api/middleware/sizelimit.py
cinder/tests/api/middleware/test_sizelimit.py