fix: #8549 send 308 Permanent Redirect on topic/category shortlinks

This commit is contained in:
Julian Lam
2020-08-06 10:48:35 -04:00
parent def16f9e97
commit 68f8d6e3a1
3 changed files with 4 additions and 4 deletions

View File

@@ -44,7 +44,7 @@ topicsController.get = async function getTopic(req, res, callback) {
}
if (!res.locals.isAPI && (!req.params.slug || topicData.slug !== tid + '/' + req.params.slug) && (topicData.slug && topicData.slug !== tid + '/')) {
return helpers.redirect(res, '/topic/' + topicData.slug + (postIndex ? '/' + postIndex : '') + (currentPage > 1 ? '?page=' + currentPage : ''));
return helpers.redirect(res, '/topic/' + topicData.slug + (postIndex ? '/' + postIndex : '') + (currentPage > 1 ? '?page=' + currentPage : ''), true);
}
if (postIndex === 'unread') {