Timothy Jaeryang Baek 7 月之前
父節點
當前提交
4f93ecf519
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      backend/open_webui/utils/auth.py

+ 4 - 1
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(