Increase the number of requests and bypass rate limits for static files
Adjusts rate limiting to allow more requests and skips rate limiting for static assets and development in `server/middleware/security.ts`. Replit-Commit-Author: Agent Replit-Commit-Session-Id: c5f0c281-8dd8-4846-b452-4a07bcd21062 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/9777c70b-fc38-4831-8d6b-78dfffe041b0/18f237e1-40ed-4521-82f6-abc2c848d54c.jpg
This commit is contained in:
@@ -6,13 +6,19 @@ import type { Request, Response, NextFunction } from 'express';
|
||||
// Rate limiting configurations
|
||||
export const generalRateLimit = rateLimit({
|
||||
windowMs: 15 * 60 * 1000, // 15 minutes
|
||||
max: 100, // 100 requests per window
|
||||
max: 1000, // 1000 requests per window (increased for development)
|
||||
message: {
|
||||
error: 'Too many requests from this IP, please try again later.',
|
||||
retryAfter: '15 minutes'
|
||||
},
|
||||
standardHeaders: true,
|
||||
legacyHeaders: false
|
||||
legacyHeaders: false,
|
||||
skip: (req) => {
|
||||
// Skip rate limiting for static assets and development
|
||||
return req.path.includes('/src/') || req.path.includes('/@') ||
|
||||
req.path.includes('.js') || req.path.includes('.css') ||
|
||||
process.env.NODE_ENV === 'development';
|
||||
}
|
||||
});
|
||||
|
||||
export const authRateLimit = rateLimit({
|
||||
|
||||
Reference in New Issue
Block a user