From f2248d4e9a84d429c4741f0243fd97ab6a7c215d Mon Sep 17 00:00:00 2001 From: dumbmoron Date: Fri, 4 Oct 2024 16:59:53 +0000 Subject: [PATCH] api/core: move api limiter after authentication --- api/src/core/api.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/src/core/api.js b/api/src/core/api.js index 4ed1524d..050825e2 100644 --- a/api/src/core/api.js +++ b/api/src/core/api.js @@ -105,7 +105,6 @@ export const runAPI = (express, app, __dirname) => { ...corsConfig, })); - app.post('/', apiLimiter); app.use('/tunnel', apiLimiterStream); app.post('/', (req, res, next) => { @@ -148,7 +147,9 @@ export const runAPI = (express, app, __dirname) => { next(); }); + app.post('/', apiLimiter); app.use('/', express.json({ limit: 1024 })); + app.use('/', (err, _, res, next) => { if (err) { const { status, body } = createResponse("error", {