From 0236ea86ad199ecb3203f5d36d8a0f8bb706aa7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 20 Sep 2021 10:24:02 -0400 Subject: [PATCH] fix: req.path doesn't have full url --- src/controllers/helpers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/helpers.js b/src/controllers/helpers.js index e525fb80cc..1173e6e2cd 100644 --- a/src/controllers/helpers.js +++ b/src/controllers/helpers.js @@ -122,7 +122,7 @@ helpers.notAllowed = async function (req, res, error) { if (req.loggedIn || req.uid === -1) { if (res.locals.isAPI) { - if (req.path.startsWith('/api/v3')) { + if (req.originalUrl.startsWith('/api/v3')) { helpers.formatApiResponse(403, res, error); } else { res.status(403).json({