fix: show hero image in thumbnail grid on hero gallery layout
Test and Lint / backend-test (push) Successful in 1m12s
continuous-integration/drone/push Build is passing
Test and Lint / frontend-test (push) Successful in 2m16s
Version and Release / version-bump (push) Successful in 35s
Version and Release / trigger-drone (push) Successful in 3s
Test and Lint / backend-test (push) Successful in 1m12s
continuous-integration/drone/push Build is passing
Test and Lint / frontend-test (push) Successful in 2m16s
Version and Release / version-bump (push) Successful in 35s
Version and Release / trigger-drone (push) Successful in 3s
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
// This is a partial server.js showing the enhanced rate limiting
|
||||
// Only the relevant parts are shown - merge with existing server.js
|
||||
|
||||
const { createSecureSkipFunction, logRateLimitHit } = require('./src/utils/rateLimitSecurity');
|
||||
|
||||
// Enhanced rate limiting with secure skip function
|
||||
const limiter = rateLimit({
|
||||
windowMs: 15 * 60 * 1000, // 15 minutes
|
||||
max: process.env.NODE_ENV === 'development' ? 1000 : 100,
|
||||
skip: createSecureSkipFunction(), // Use secure skip function
|
||||
handler: (req, res) => {
|
||||
logRateLimitHit(req, res);
|
||||
res.status(429).json({
|
||||
error: 'Too many requests from this IP, please try again later.'
|
||||
});
|
||||
},
|
||||
standardHeaders: true, // Return rate limit info in headers
|
||||
legacyHeaders: false, // Disable X-RateLimit headers
|
||||
});
|
||||
|
||||
const authLimiter = rateLimit({
|
||||
windowMs: 15 * 60 * 1000,
|
||||
max: 5, // limit auth attempts
|
||||
skipSuccessfulRequests: true, // Don't count successful logins
|
||||
handler: (req, res) => {
|
||||
logRateLimitHit(req, res);
|
||||
res.status(429).json({
|
||||
error: 'Too many login attempts, please try again later.',
|
||||
retryAfter: res.getHeader('Retry-After')
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user