summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorEric Day <eday@oddments.org>2010-10-16 08:19:04 +0000
committerTarmac <>2010-10-16 08:19:04 +0000
commitfbe47ae3be6b18007ff8e4a74ad6efe748421dc5 (patch)
tree0749392c4da8a859ce2a6971735aa15682adab12 /nova/api
parent24de0631b622014323a4348ebc8408fadbafe99a (diff)
parenta340d3fe1b8e1f657351c8a32ff74b3cbcc3a8ff (diff)
Added test case to reproduce bug #660668 and provided a fix by using the user_id from the auth layer instead of the username header.
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/nova/api/openstack/__init__.py b/nova/api/openstack/__init__.py
index 5e81ba2bd..5706dbc09 100644
--- a/nova/api/openstack/__init__.py
+++ b/nova/api/openstack/__init__.py
@@ -106,11 +106,11 @@ class RateLimitingMiddleware(wsgi.Middleware):
If the request should be rate limited, return a 413 status with a
Retry-After header giving the time when the request would succeed.
"""
- username = req.headers['X-Auth-User']
+ user_id = req.environ['nova.context']['user']['id']
action_name = self.get_action_name(req)
if not action_name: # not rate limited
return self.application
- delay = self.get_delay(action_name, username)
+ delay = self.get_delay(action_name, user_id)
if delay:
# TODO(gundlach): Get the retry-after format correct.
exc = webob.exc.HTTPRequestEntityTooLarge(