bypass cors for everything (#445)
This commit is contained in:
parent
94a4157c0d
commit
99dda626d1
1 changed files with 14 additions and 0 deletions
|
|
@ -96,6 +96,19 @@ if (!IS_VANILLA && !IS_EXTENSION) {
|
|||
}
|
||||
});
|
||||
|
||||
protocol.handle("https", async req => {
|
||||
const res = await net.fetch(req, { bypassCustomProtocolHandlers: true });
|
||||
const headers = new Headers(res.headers);
|
||||
headers.set("Access-Control-Allow-Origin", "*");
|
||||
headers.set("Access-Control-Allow-Methods", "*");
|
||||
headers.set("Access-Control-Allow-Headers", "*");
|
||||
|
||||
return new Response(res.body, {
|
||||
...res,
|
||||
headers,
|
||||
});
|
||||
});
|
||||
|
||||
try {
|
||||
if (RendererSettings.store.enableReactDevtools)
|
||||
installExt("fmkadmapgofadopljbjfkapdkoienihi")
|
||||
|
|
@ -106,6 +119,7 @@ if (!IS_VANILLA && !IS_EXTENSION) {
|
|||
|
||||
initCsp();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
if (IS_DISCORD_DESKTOP) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue