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