返回提交历史
Modified
g4f/api/__init__.py
+1
-3
XFEstudio/gpt4free
Refactor request logging middleware to always log requests and update demo path checks
3dd38f45
代码差异
1 个文件
+1
-3
@@ -291,8 +291,6 @@ def create_app():
291
291
292
292
@app.middleware("http")
293
293
async def log_requests(request: Request, call_next):
294
if AppConfig.demo:
295
return await call_next(request)
296
294
global _log_id_counter
297
295
path = request.url.path
298
296
if any(path.startswith(p) for p in _LOG_SKIP_PREFIXES) or path in _LOG_SKIP_EXACT:
@@ -480,7 +478,7 @@ class Api:
480
478
path.startswith("/v1/")
481
479
or (path.startswith("/api/") and path != "/api/logs")
482
480
or (path.startswith("/pa/") and not demo)
483
or (demo and path in ["/backend-api/v2/upload_cookies"])
481
or (demo and path in ["/backend-api/v2/upload_cookies", "/api/logs"])
484
482
)
485
483
486
484
@self.app.middleware("http")