mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
fix: #9698, pass along query params in redirect
This commit is contained in:
@@ -27,7 +27,8 @@ Users.redirectBySlug = async (req, res) => {
|
|||||||
|
|
||||||
if (uid) {
|
if (uid) {
|
||||||
const path = req.path.split('/').slice(3).join('/');
|
const path = req.path.split('/').slice(3).join('/');
|
||||||
res.redirect(308, nconf.get('relative_path') + encodeURI(`/api/v3/users/${uid}/${path}`));
|
const urlObj = new URL(nconf.get('url') + req.url);
|
||||||
|
res.redirect(308, nconf.get('relative_path') + encodeURI(`/api/v3/users/${uid}/${path}${urlObj.search}`));
|
||||||
} else {
|
} else {
|
||||||
helpers.formatApiResponse(404, res);
|
helpers.formatApiResponse(404, res);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user