From a340d3fe1b8e1f657351c8a32ff74b3cbcc3a8ff Mon Sep 17 00:00:00 2001 From: Eric Day Date: Thu, 14 Oct 2010 18:17:56 -0700 Subject: 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. --- nova/api/openstack/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nova/api') 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( -- cgit