From ff2b33b772ec4755bee336a8d7c88e653a6ab9d4 Mon Sep 17 00:00:00 2001 From: Arefiev Anton Date: Thu, 25 Apr 2024 14:53:13 +0300 Subject: [PATCH] Raise HTTPUnauthorized in ContextMiddleware in this place exsception should be raised, not returned. Change-Id: I6f01608548defd5182137d7287009ec7ab1756ea --- barbican/api/middleware/context.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/barbican/api/middleware/context.py b/barbican/api/middleware/context.py index a114998a8..499c66c4e 100644 --- a/barbican/api/middleware/context.py +++ b/barbican/api/middleware/context.py @@ -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