fix: req.path doesn't have full url

This commit is contained in:
Barış Soner Uşaklı
2021-09-20 10:24:02 -04:00
parent 75ebe78619
commit 0236ea86ad

View File

@@ -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({