Fix WebUI authentication bypass for /chat/ endpoint

Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-08-19 14:08:38 +00:00
parent 1c93b936bb
commit d0ce56689c

View File

@@ -269,7 +269,7 @@ class Api:
if user_g4f_api_key is not None:
if user is None:
return ErrorResponse.from_message("Invalid G4F API key", HTTP_403_FORBIDDEN)
elif path.startswith("/backend-api/") or path.startswith("/chat/") and path != "/chat/":
elif path.startswith("/backend-api/") or path.startswith("/chat/"):
try:
user = await self.get_username(request)
except HTTPException as e: