From ac38c2c61dd17bd5324ab98ed5dcc7e1bfd6c754 Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Wed, 24 Mar 2021 22:34:51 -0500 Subject: increase ratelimits --- src/index.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index fbab327..4cf8dae 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,12 +7,15 @@ const app = express() export const debug = false -// 250 requests over 5 minutes +// 500 requests over 5 minutes const limiter = rateLimit({ windowMs: 60 * 1000 * 5, - max: 250, - skip: (req: express.Request, res) => { + max: 500, + skip: (req: express.Request) => { return req.headers.key === process.env.key + }, + keyGenerator: (req: express.Request) => { + return (req.headers['Cf-Connecting-Ip'] ?? req.ip).toString() } }) -- cgit