Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix: allow file protocol streaming (#4441)

Peng Xiao872dc3521b20
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');