mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
fix: ws prefix url in electron (#1896)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { protocol } from 'electron';
|
||||
import { protocol, session } from 'electron';
|
||||
import { join } from 'path';
|
||||
|
||||
export function registerProtocol() {
|
||||
@@ -20,4 +20,15 @@ export function registerProtocol() {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
session.defaultSession.webRequest.onHeadersReceived(
|
||||
(responseDetails, callback) => {
|
||||
const { responseHeaders, url } = responseDetails;
|
||||
if (responseHeaders) {
|
||||
responseHeaders['Access-Control-Allow-Origin'] = ['*'];
|
||||
}
|
||||
|
||||
callback({ responseHeaders });
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user