bypass cors for everything (#445)

This commit is contained in:
vMohammad 2025-10-07 22:21:46 +03:00 • committed by GitHub
parent 94a4157c0d
commit 99dda626d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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) {