XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

Update __init__.py

7c8cf456
H Lohaus <hlohaus@users.noreply.github.com>
提交于

代码差异

1 个文件 +7 -0
Modified g4f/api/__init__.py +7 -0
@@ -267,6 +267,13 @@ class Api:
267 267 return ErrorResponse.from_message("G4F API key expired", HTTP_401_UNAUTHORIZED)
268 268 else:
269 269 user = "admin"
270
271 count = 0
272 for char in string:
273 if char.isupper():
274 count += 1
275 if count > 5:
276 return ErrorResponse.from_message("Invalid user name", HTTP_401_UNAUTHORIZED)
270 277 path = request.url.path
271 278 if path.startswith("/v1") or path.startswith("/api/") or (AppConfig.demo and path == '/backend-api/v2/upload_cookies'):
272 279 if request.method != "OPTIONS" and not path.endswith("/models"):