Merge pull request #3131 from xtekky/copilot/fix-3128

Fix WebUI authentication bypass for /chat/ endpoint
This commit is contained in:
H Lohaus 2025-08-21 08:52:11 +02:00 committed by GitHub
commit df3c34cd69
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -273,7 +273,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: