From a3e8d5fd384c5ba3c84fd1802a74fe045c27b8a8 Mon Sep 17 00:00:00 2001 From: Shroominic Date: Wed, 24 Dec 2025 15:09:03 +0100 Subject: [PATCH] ignore cloudflare headers from logs --- routstr/core/middleware.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/routstr/core/middleware.py b/routstr/core/middleware.py index 4307cb9d..1810f055 100644 --- a/routstr/core/middleware.py +++ b/routstr/core/middleware.py @@ -55,7 +55,16 @@ class LoggingMiddleware(BaseHTTPMiddleware): "headers": { k: v for k, v in request.headers.items() - if k.lower() not in ["authorization", "x-cashu", "cookie"] + if k.lower() + not in [ + "authorization", + "x-cashu", + "cookie", + "cf-connecting-ip", + "cf-ipcountry", + "x-forwarded-for", + "x-real-ip", + ] }, "body_size": len(request_body) if request_body else 0, },