From eb66b789baa10b8586c2ea0597dfe0e26ac99e93 Mon Sep 17 00:00:00 2001 From: Dean Whillier Date: Wed, 12 Feb 2020 12:48:44 -0500 Subject: [PATCH] =?UTF-8?q?Use=20=E2=80=98isTrustedURL=E2=80=99=20function?= =?UTF-8?q?=20to=20validate=20url=20(#1190)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main.js b/src/main.js index 45fb35c8..1020340e 100644 --- a/src/main.js +++ b/src/main.js @@ -769,12 +769,8 @@ function initializeAfterAppReady() { // get the requesting webContents url const requestingURL = webContents.getURL(); - // is the target url trusted? - const matchingTeamIndex = config.teams.findIndex((team) => { - return requestingURL.startsWith(team.url); - }); - - callback(matchingTeamIndex >= 0); + // is the requesting url trusted? + callback(isTrustedURL(requestingURL)); }); }