Use ‘isTrustedURL’ function to validate url (#1190)
This commit is contained in:
@@ -769,12 +769,8 @@ function initializeAfterAppReady() {
|
|||||||
// get the requesting webContents url
|
// get the requesting webContents url
|
||||||
const requestingURL = webContents.getURL();
|
const requestingURL = webContents.getURL();
|
||||||
|
|
||||||
// is the target url trusted?
|
// is the requesting url trusted?
|
||||||
const matchingTeamIndex = config.teams.findIndex((team) => {
|
callback(isTrustedURL(requestingURL));
|
||||||
return requestingURL.startsWith(team.url);
|
|
||||||
});
|
|
||||||
|
|
||||||
callback(matchingTeamIndex >= 0);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user