aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/index.ts9
1 files 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()
}
})