increase rate limit when testing

deepsource-autofix-76c6eb20
Dan Gowans 2023-01-11 15:09:06 -05:00
parent 24067317c9
commit 9a955ce852
2 changed files with 4 additions and 2 deletions

3
app.js
View File

@ -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 !== '') {

3
app.ts
View File

@ -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
})
)