mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-16 15:40:02 -04:00
guh
This commit is contained in:
commit
7f90663cc4
7 changed files with 578 additions and 650 deletions
|
@ -58,18 +58,7 @@ export async function swfetch(
|
|||
console.log(dataurl);
|
||||
}
|
||||
|
||||
let response: Response = await fetch(dataurl, {
|
||||
// this is extremely redundant but i don't care
|
||||
// method: request.method,
|
||||
// body: request.body,
|
||||
// headers: request.headers,
|
||||
// credentials: "omit",
|
||||
// mode: request.mode === "cors" ? request.mode : "same-origin",
|
||||
// cache: request.cache,
|
||||
// redirect: "manual",
|
||||
// //@ts-ignore
|
||||
// duplex: "half",
|
||||
});
|
||||
let response: Response = await fetch(dataurl, {});
|
||||
|
||||
let body: BodyType;
|
||||
|
||||
|
@ -85,8 +74,12 @@ export async function swfetch(
|
|||
this.cookieStore
|
||||
);
|
||||
}
|
||||
let headers = Object.fromEntries(response.headers.entries());
|
||||
headers["Cross-Origin-Embedder-Policy"] = "require-corp";
|
||||
const headers = Object.fromEntries(response.headers.entries());
|
||||
|
||||
if (crossOriginIsolated) {
|
||||
headers["Cross-Origin-Opener-Policy"] = "same-origin";
|
||||
headers["Cross-Origin-Embedder-Policy"] = "require-corp";
|
||||
}
|
||||
|
||||
return new Response(body, {
|
||||
status: response.status,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue