From 872dc3521b20e060e8ec101fbe166a2d5f6578f2 Mon Sep 17 00:00:00 2001 From: Peng Xiao Date: Thu, 21 Sep 2023 19:10:03 +0800 Subject: [PATCH] fix: allow file protocol streaming (#4441) --- apps/electron/src/main/protocol.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/apps/electron/src/main/protocol.ts b/apps/electron/src/main/protocol.ts index 8c9c82c686..20cb933d81 100644 --- a/apps/electron/src/main/protocol.ts +++ b/apps/electron/src/main/protocol.ts @@ -18,6 +18,20 @@ protocol.registerSchemesAsPrivileged([ }, ]); +protocol.registerSchemesAsPrivileged([ + { + scheme: 'file', + privileges: { + secure: false, + corsEnabled: true, + supportFetchAPI: true, + standard: true, + bypassCSP: true, + stream: true, + }, + }, +]); + const NETWORK_REQUESTS = ['/api', '/ws', '/socket.io', '/graphql']; const webStaticDir = join(__dirname, '../resources/web-static');