Raise HTTPUnauthorized in ContextMiddleware

in this place exsception should be raised, not returned.

Change-Id: I6f01608548defd5182137d7287009ec7ab1756ea
This commit is contained in:
Arefiev Anton 2024-04-25 14:53:13 +03:00 committed by Pavlo Shchelokovskyy
parent da7482eab0
commit ff2b33b772

View File

@ -88,7 +88,7 @@ class ContextMiddleware(BaseContextMiddleware):
if ctx.project_id is None:
LOG.debug("X_PROJECT_ID not found in request")
return webob.exc.HTTPUnauthorized()
raise webob.exc.HTTPUnauthorized()
ctx.is_admin = CONF.admin_role.strip().lower() in ctx.roles