This commit is contained in:
Barış Soner Uşaklı
2020-11-14 19:56:01 -05:00
parent 29c2ca94f4
commit f14e42d8bc
2 changed files with 3 additions and 2 deletions

View File

@@ -144,7 +144,7 @@ helpers.notAllowed = async function (req, res, error) {
};
helpers.redirect = function (res, url, permanent) {
if (res.locals.isAPI && !url.startsWith('/api/v3/')) {
if (res.locals.isAPI) {
res.set('X-Redirect', encodeURI(url)).status(200).json(url);
} else {
res.redirect(permanent ? 308 : 307, relative_path + encodeURI(url));