disable rate limiter in dev env too

This commit is contained in:
lesion 2024-04-01 10:28:51 +02:00
parent 03ce30a9cf
commit e193efa304
No known key found for this signature in database
GPG key ID: 352918250B012177

View file

@ -5,7 +5,7 @@ const next = (req, res, next) => next()
const instanceApiRateLimiter = {
DDOSProtectionApiRateLimiter: (process.env.NODE_ENV === 'test' ? next : rateLimit({
DDOSProtectionApiRateLimiter: (process.env.NODE_ENV !== 'production' ? next : rateLimit({
windowMs: 60 * 1000, // 1 minutes
max: 250, // Limit each IP to 150 requests per `window`
standardHeaders: true, // Return rate limit info in the `RateLimit-*` headers
@ -19,7 +19,7 @@ const instanceApiRateLimiter = {
/** This is a limiter used to avoid spam
* (used during the registration, pass recovery, posting events) */
SPAMProtectionApiRateLimiter: (process.env.NODE_ENV === 'test' ? next : rateLimit({
SPAMProtectionApiRateLimiter: (process.env.NODE_ENV !== 'production' ? next : rateLimit({
windowMs: 5 * 60 * 1000, // 5 minutes
max: 6, // Limit each IP to 3 requests per `window` (here, per 5 minutes)
standardHeaders: true, // Return rate limit info in the `RateLimit-*` headers