mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
test: fix path replace
This commit is contained in:
@@ -254,7 +254,7 @@ module.exports = function (middleware) {
|
||||
if (res.locals.isAPI) {
|
||||
req.params.userslug = lowercaseSlug;
|
||||
} 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}`);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user