fix: 日志页 /admin/logs 自引用不记录(5s 轮询刷屏)
Browse files- app/http_log.py +2 -1
app/http_log.py
CHANGED
|
@@ -257,7 +257,8 @@ class RequestResponseLogMiddleware(BaseHTTPMiddleware):
|
|
| 257 |
"""记录请求 header/body、响应 body、耗时、usage;跳过 ``/healthz``。"""
|
| 258 |
|
| 259 |
async def dispatch(self, request: Request, call_next: Any) -> Response:
|
| 260 |
-
if request.url.path in ("/healthz", "/favicon.ico"):
|
|
|
|
| 261 |
return await call_next(request)
|
| 262 |
|
| 263 |
settings = _settings_from_request(request)
|
|
|
|
| 257 |
"""记录请求 header/body、响应 body、耗时、usage;跳过 ``/healthz``。"""
|
| 258 |
|
| 259 |
async def dispatch(self, request: Request, call_next: Any) -> Response:
|
| 260 |
+
if request.url.path in ("/healthz", "/favicon.ico", "/admin/logs"):
|
| 261 |
+
# /admin/logs 是日志页自引用:记录它会刷屏(每 5s 一条大 body)
|
| 262 |
return await call_next(request)
|
| 263 |
|
| 264 |
settings = _settings_from_request(request)
|