summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorEric Day <eday@oddments.org>2010-10-14 18:17:56 -0700
committerEric Day <eday@oddments.org>2010-10-14 18:17:56 -0700
commita340d3fe1b8e1f657351c8a32ff74b3cbcc3a8ff (patch)
treed22a01658c5abae6c2cc4d8427a4c4c1a8c571c4 /nova/api
parent7013fb5c8f5883bae46c2407b3a7beb4412081bc (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(