mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: #9032
This commit is contained in:
@@ -148,14 +148,14 @@ helpers.redirect = function (res, url, permanent) {
|
|||||||
let redirectUrl;
|
let redirectUrl;
|
||||||
// this is used by sso plugins to redirect to the auth route
|
// this is used by sso plugins to redirect to the auth route
|
||||||
if (url.hasOwnProperty('external')) {
|
if (url.hasOwnProperty('external')) {
|
||||||
url.external = encodeURI(url.external);
|
|
||||||
redirectUrl = url.external;
|
redirectUrl = url.external;
|
||||||
|
url.external = encodeURI(url.external);
|
||||||
} else {
|
} else {
|
||||||
url = encodeURI(url);
|
|
||||||
redirectUrl = url;
|
redirectUrl = url;
|
||||||
|
url = encodeURI(url);
|
||||||
}
|
}
|
||||||
if (res.locals.isAPI) {
|
if (res.locals.isAPI) {
|
||||||
res.set('X-Redirect', redirectUrl).status(200).json(url);
|
res.set('X-Redirect', encodeURI(redirectUrl)).status(200).json(url);
|
||||||
} else {
|
} else {
|
||||||
redirectUrl = redirectUrl.startsWith('http://') || redirectUrl.startsWith('https://') ?
|
redirectUrl = redirectUrl.startsWith('http://') || redirectUrl.startsWith('https://') ?
|
||||||
redirectUrl : relative_path + redirectUrl;
|
redirectUrl : relative_path + redirectUrl;
|
||||||
|
|||||||
Reference in New Issue
Block a user