fix: bypass rate limiting for internal network IPs (10.1.223.93, 10.1.223.40)
Some checks failed
Integration Tests / test-service-integration (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled

This commit is contained in:
aitbc
2026-03-31 14:51:46 +02:00
parent a510b9bdb4
commit 209f1e46f5

View File

@@ -32,8 +32,8 @@ class RateLimitMiddleware(BaseHTTPMiddleware):
async def dispatch(self, request: Request, call_next):
client_ip = request.client.host if request.client else "unknown"
# Bypass rate limiting for localhost (sync/health internal traffic)
if client_ip in {"127.0.0.1", "::1"}:
# Bypass rate limiting for localhost and internal network (sync/health internal traffic)
if client_ip in {"127.0.0.1", "::1", "10.1.223.93", "10.1.223.40"}:
return await call_next(request)
now = time.time()
# Clean old entries