0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 16:22:44 +00:00

reduce rate limit to 60 requests in 5 minutes

This commit is contained in:
Trevor Buckner
2024-09-30 00:03:27 -04:00
parent 68895bdca2
commit 32fa272947

View File

@@ -28,7 +28,7 @@ const isStaticTheme = (renderer, themeName)=>{
// Define rate limiter options
const rateLimiter = rateLimit({
timeWindow : 5 * 60 * 1000, // 5 minutes window
max : 100, // limit each IP to 100 requests per timeWindow
max : 60, // limit each IP to 100 requests per timeWindow
handler: (req, res, next) => {
console.log(`Rate limiting user ${req.account?.username}`);
throw { HBErrorCode: '55', status: 429, message: 'Too many requests from this IP, please try again after 5 minutes'};