aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaúl Ibarra Corretgé <s@saghul.net>2023-05-26 14:11:38 +0200
committerSaúl Ibarra Corretgé <s@saghul.net>2023-05-26 14:31:30 +0200
commit6e968b87969d5e2a5317951dbb3c6b202f8e0fff (patch)
tree0b1e1fbb131278a71c42ef48e8af98a6d7d50932
parent043272c63c258d994e155b0c14979d885d785363 (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.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/main.js b/main.js
index 877383a..0bc659c 100644
--- a/main.js
+++ b/main.js
@@ -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}`);