From 9a955ce85282ec1174b57e05f7561d85fb711de8 Mon Sep 17 00:00:00 2001 From: Dan Gowans Date: Wed, 11 Jan 2023 15:09:06 -0500 Subject: [PATCH] increase rate limit when testing --- app.js | 3 ++- app.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index a4d8ae48..010b3775 100644 --- a/app.js +++ b/app.js @@ -28,6 +28,7 @@ import * as databaseInitializer from './helpers/initializer.database.js'; import { apiGetHandler } from './handlers/permissions.js'; import { getSafeRedirectURL } from './helpers/functions.authentication.js'; import debug from 'debug'; +import { useTestDatabases } from './data/databasePaths.js'; const debugApp = debug('lot-occupancy-system:app'); databaseInitializer.initializeDatabase(); const _dirname = '.'; @@ -55,7 +56,7 @@ app.use(csurf({ })); app.use(rateLimit({ windowMs: 10000, - max: 200 + max: useTestDatabases ? 1000000 : 200 })); const urlPrefix = configFunctions.getProperty('reverseProxy.urlPrefix'); if (urlPrefix !== '') { diff --git a/app.ts b/app.ts index 6c4288af..9b8a4002 100644 --- a/app.ts +++ b/app.ts @@ -36,6 +36,7 @@ import { apiGetHandler } from './handlers/permissions.js' import { getSafeRedirectURL } from './helpers/functions.authentication.js' import debug from 'debug' +import { useTestDatabases } from './data/databasePaths.js' const debugApp = debug('lot-occupancy-system:app') /* @@ -93,7 +94,7 @@ app.use( app.use( rateLimit({ windowMs: 10_000, - max: 200 + max: useTestDatabases ? 1_000_000 : 200 }) )