From 82d2cf3eb193165318bfcbc0a3c8b864d336fda1 Mon Sep 17 00:00:00 2001 From: natlibfi-jonollil <53558796+natlibfi-jonollil@users.noreply.github.com> Date: Thu, 14 Nov 2024 12:20:14 +0200 Subject: [PATCH] fix-lint --- src/routes/urlRoute.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/routes/urlRoute.js b/src/routes/urlRoute.js index e82f50b..f8c3e6f 100644 --- a/src/routes/urlRoute.js +++ b/src/routes/urlRoute.js @@ -13,8 +13,8 @@ export default function (urlWhiteList) { function handleHook(req, res) { const {triggerUrl} = req.query; - if (!urlWhiteList.some(urlRegexp => new RegExp(urlRegexp, 'u').test(url))) { - res.status(httpStatus.FORBIDDEN).json({status: 403}); + if (!urlWhiteList.some(urlRegexp => new RegExp(urlRegexp, 'u').test(triggerUrl))) { + return res.status(httpStatus.FORBIDDEN).json({status: 403}); } const data = req.body; @@ -32,4 +32,4 @@ export default function (urlWhiteList) { ); res.status(httpStatus.OK).json({status: 200}); } -} \ No newline at end of file +}