mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-20 15:30:39 +01:00
fix: #8549 send 308 Permanent Redirect on topic/category shortlinks
This commit is contained in:
@@ -151,11 +151,11 @@ helpers.notAllowed = async function (req, res, error) {
|
||||
}
|
||||
};
|
||||
|
||||
helpers.redirect = function (res, url) {
|
||||
helpers.redirect = function (res, url, permanent) {
|
||||
if (res.locals.isAPI) {
|
||||
res.set('X-Redirect', encodeURI(url)).status(200).json(url);
|
||||
} else {
|
||||
res.redirect(nconf.get('relative_path') + encodeURI(url));
|
||||
res.redirect(permanent ? 308 : 307, nconf.get('relative_path') + encodeURI(url));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user