From 5f754dce1f13b33c06752298a2c4241af877f690 Mon Sep 17 00:00:00 2001 From: Walter Moar Date: Wed, 23 Oct 2024 08:28:01 -0700 Subject: [PATCH] fix: FORMS-1303 restrict rate limit to api routes (#1524) The express rate limiter is now applied globally, so that all routes are included. However, it needs to be restricted to only the API - the Vue files, etc, should not be involved in the rate limiting. --- app/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/app.js b/app/app.js index f81e48432..c9f41e61a 100644 --- a/app/app.js +++ b/app/app.js @@ -53,7 +53,7 @@ app.use((_req, res, next) => { } }); -app.use(rateLimiter); +app.use(config.get('server.basePath') + config.get('server.apiPath'), rateLimiter); // Frontend configuration endpoint apiRouter.use('/config', (_req, res, next) => {