mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
test: fix path replace
This commit is contained in:
@@ -254,7 +254,7 @@ module.exports = function (middleware) {
|
|||||||
if (res.locals.isAPI) {
|
if (res.locals.isAPI) {
|
||||||
req.params.userslug = lowercaseSlug;
|
req.params.userslug = lowercaseSlug;
|
||||||
} else {
|
} else {
|
||||||
const newPath = req.path.replace(new RegExp(`/${req.params.userslug}/`), () => `/${lowercaseSlug}/`);
|
const newPath = req.path.replace(new RegExp(`/${req.params.userslug}`), () => `/${lowercaseSlug}`);
|
||||||
return res.redirect(`${nconf.get('relative_path')}${newPath}`);
|
return res.redirect(`${nconf.get('relative_path')}${newPath}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user