attempt to fix codeql vulnerability
parent
2b6ef96851
commit
4090714ace
|
|
@ -4,6 +4,7 @@ import * as authenticationFunctions from "../helpers/functions.authentication.js
|
|||
export const router = Router();
|
||||
const getSafeRedirectURL = (possibleRedirectURL = "") => {
|
||||
const urlPrefix = configFunctions.getProperty("reverseProxy.urlPrefix");
|
||||
if (typeof (possibleRedirectURL) === "string") {
|
||||
const urlToCheck = (possibleRedirectURL.startsWith(urlPrefix) ?
|
||||
possibleRedirectURL.slice(urlPrefix.length) :
|
||||
possibleRedirectURL).toLowerCase();
|
||||
|
|
@ -16,6 +17,7 @@ const getSafeRedirectURL = (possibleRedirectURL = "") => {
|
|||
case "/reports":
|
||||
return urlPrefix + urlToCheck;
|
||||
}
|
||||
}
|
||||
return urlPrefix + "/dashboard";
|
||||
};
|
||||
router.route("/")
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ const getSafeRedirectURL = (possibleRedirectURL = "") => {
|
|||
|
||||
const urlPrefix = configFunctions.getProperty("reverseProxy.urlPrefix");
|
||||
|
||||
if (typeof (possibleRedirectURL) === "string") {
|
||||
|
||||
const urlToCheck = (possibleRedirectURL.startsWith(urlPrefix) ?
|
||||
possibleRedirectURL.slice(urlPrefix.length) :
|
||||
possibleRedirectURL).toLowerCase();
|
||||
|
|
@ -29,6 +31,7 @@ const getSafeRedirectURL = (possibleRedirectURL = "") => {
|
|||
|
||||
return urlPrefix + urlToCheck;
|
||||
}
|
||||
}
|
||||
|
||||
return urlPrefix + "/dashboard";
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue