From 7e79f8d1c6b5a02f1a46e792540c6bbf7bed8edc Mon Sep 17 00:00:00 2001 From: Tim Baek Date: Fri, 6 Feb 2026 22:39:20 +0400 Subject: [PATCH] refac --- backend/open_webui/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index d505e77f3..2d0aeecf1 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -1329,7 +1329,9 @@ class APIKeyRestrictionMiddleware(BaseHTTPMiddleware): token = None if auth_header: - scheme, token = auth_header.split(" ") + parts = auth_header.split(" ", 1) + if len(parts) == 2: + token = parts[1] # Only apply restrictions if an sk- API key is used if token and token.startswith("sk-"):