From 5fe1fc6ed3cee0e01d0aa732f8c5b6a9c47e93f1 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 23 Mar 2024 00:30:52 -0700 Subject: don't rate limit static resources --- lib/app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/app.js b/lib/app.js index 337b2e96..5019cda3 100644 --- a/lib/app.js +++ b/lib/app.js @@ -20,7 +20,8 @@ const app = fastify({ }); await app.register(import("@fastify/rate-limit"), { - max: 50, + allowList: (req, key) => req.raw.url.includes("public"), + max: 100, timeWindow: 2000, keyGenerator: (req) => req.headers["cf-connecting-ip"], }); -- cgit v1.2.3