fix: for subfolders

This commit is contained in:
Barış Soner Uşaklı
2021-09-20 10:39:56 -04:00
parent 0236ea86ad
commit 31a6d4b39a

View File

@@ -122,7 +122,8 @@ helpers.notAllowed = async function (req, res, error) {
if (req.loggedIn || req.uid === -1) {
if (res.locals.isAPI) {
if (req.originalUrl.startsWith('/api/v3')) {
const cleanedUrl = req.originalUrl.replace(new RegExp(`^${relative_path}`), '');
if (cleanedUrl.startsWith('/api/v3')) {
helpers.formatApiResponse(403, res, error);
} else {
res.status(403).json({