소스 검색

出去health日志

ChenYu 7 달 전
부모
커밋
62860ce693
2개의 변경된 파일과 6개의 추가작업 그리고 1개의 파일을 삭제
  1. BIN
      app/middleware/__pycache__/api_key.cpython-312.pyc
  2. 6 1
      app/middleware/api_key.py

BIN
app/middleware/__pycache__/api_key.cpython-312.pyc


+ 6 - 1
app/middleware/api_key.py

@@ -17,9 +17,14 @@ class ApiKeyMiddleware(BaseHTTPMiddleware):
         path = request.url.path
         client_ip = request.client.host if request.client else "unknown"
 
-        logger.info("--> %s %s  (client=%s)", method, path, client_ip)
         t0 = time.time()
 
+        if path == "/health":
+            response = await call_next(request)
+            return response
+
+        logger.info("--> %s %s  (client=%s)", method, path, client_ip)
+
         if settings.api_auth_enabled and path != "/health":
             header_value = request.headers.get(settings.api_auth_header_name, "")
             prefix = settings.api_auth_prefix