mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-24 13:07:53 +08:00
Fix WebUI authentication bypass for /chat/ endpoint
Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com>
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user