mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-16 20:07:49 +01:00
Fix API_KEY_ALLOWED_ENDPOINTS
This commit is contained in:
committed by
GitHub
parent
be20e6dec0
commit
1c57e3e02c
@@ -182,7 +182,11 @@ def get_current_user(
|
|||||||
).split(",")
|
).split(",")
|
||||||
]
|
]
|
||||||
|
|
||||||
if request.url.path not in allowed_paths:
|
# Check if the request path matches any allowed endpoint.
|
||||||
|
if not any(
|
||||||
|
request.url.path == allowed or request.url.path.startswith(allowed + "/")
|
||||||
|
for allowed in allowed_paths
|
||||||
|
):
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status.HTTP_403_FORBIDDEN, detail=ERROR_MESSAGES.API_KEY_NOT_ALLOWED
|
status.HTTP_403_FORBIDDEN, detail=ERROR_MESSAGES.API_KEY_NOT_ALLOWED
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user