Skip to content

Commit

Permalink
fix: always use a string as the key (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
raisedadead authored Jun 16, 2024
1 parent 3f4fcd3 commit 9c1f986
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/config/rateLimitConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ export default rateLimit({
max: 100, // limit each IP to 100 requests per windowMs
standardHeaders: true,
legacyHeaders: false,
keyGenerator: req => {
return req.headers['x-forwarded-for'] || 'localhost';
},
keyGenerator: req => String(req.headers['x-forwarded-for'] || 'localhost'),
message: 'Too many requests from this IP, please try again later.'
});

0 comments on commit 9c1f986

Please sign in to comment.