diff options
author | Saúl Ibarra Corretgé <s@saghul.net> | 2023-05-26 14:11:38 +0200 |
---|---|---|
committer | Saúl Ibarra Corretgé <s@saghul.net> | 2023-05-26 14:31:30 +0200 |
commit | 6e968b87969d5e2a5317951dbb3c6b202f8e0fff (patch) | |
tree | 0b1e1fbb131278a71c42ef48e8af98a6d7d50932 | |
parent | 043272c63c258d994e155b0c14979d885d785363 (diff) |
fix(main) fix path matchingv2023.5.3
Use Node's helper to transform a file URL into a path, which works
across platforms.
Fixes: https://github.com/jitsi/jitsi-meet-electron/issues/870
-rw-r--r-- | main.js | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -245,11 +245,10 @@ function createJitsiMeetWindow() { }; mainWindow.webContents.session.webRequest.onBeforeSendHeaders(fileFilter, (details, callback) => { - const requestedUrl = new URL.URL(details.url); - const requestedBasename = path.resolve(decodeURIComponent(requestedUrl.pathname)); + const requestedPath = path.resolve(URL.fileURLToPath(details.url)); const appBasePath = path.resolve(basePath); - if (!requestedBasename.startsWith(appBasePath)) { + if (!requestedPath.startsWith(appBasePath)) { callback({ cancel: true }); console.warn(`Rejected file URL: ${details.url}`); |