mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
disable rate limiter in dev env too
This commit is contained in:
parent
03ce30a9cf
commit
e193efa304
1 changed files with 2 additions and 2 deletions
|
@ -5,7 +5,7 @@ const next = (req, res, next) => next()
|
||||||
|
|
||||||
const instanceApiRateLimiter = {
|
const instanceApiRateLimiter = {
|
||||||
|
|
||||||
DDOSProtectionApiRateLimiter: (process.env.NODE_ENV === 'test' ? next : rateLimit({
|
DDOSProtectionApiRateLimiter: (process.env.NODE_ENV !== 'production' ? next : rateLimit({
|
||||||
windowMs: 60 * 1000, // 1 minutes
|
windowMs: 60 * 1000, // 1 minutes
|
||||||
max: 250, // Limit each IP to 150 requests per `window`
|
max: 250, // Limit each IP to 150 requests per `window`
|
||||||
standardHeaders: true, // Return rate limit info in the `RateLimit-*` headers
|
standardHeaders: true, // Return rate limit info in the `RateLimit-*` headers
|
||||||
|
@ -19,7 +19,7 @@ const instanceApiRateLimiter = {
|
||||||
|
|
||||||
/** This is a limiter used to avoid spam
|
/** This is a limiter used to avoid spam
|
||||||
* (used during the registration, pass recovery, posting events) */
|
* (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
|
windowMs: 5 * 60 * 1000, // 5 minutes
|
||||||
max: 6, // Limit each IP to 3 requests per `window` (here, per 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
|
standardHeaders: true, // Return rate limit info in the `RateLimit-*` headers
|
||||||
|
|
Loading…
Reference in a new issue