From 4f93ecf51974e6cd2be7f9af6dfbf19f9c3eb539 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Thu, 26 Dec 2024 20:58:46 -0800 Subject: [PATCH] refac --- backend/open_webui/utils/auth.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/utils/auth.py b/backend/open_webui/utils/auth.py index 7da93430a..b4af770d1 100644 --- a/backend/open_webui/utils/auth.py +++ b/backend/open_webui/utils/auth.py @@ -97,7 +97,10 @@ def get_current_user( ) if request.app.state.ENABLE_API_KEY_ENDPOINT_RESTRICTIONS: - allowed_paths = str(request.app.state.API_KEY_ALLOWED_ENDPOINTS).split(",") + allowed_paths = [ + path.strip() + for path in str(request.app.state.API_KEY_ALLOWED_PATHS).split(",") + ] if request.url.path not in allowed_paths: raise HTTPException(