This commit is contained in:
velzie 2024-10-12 14:25:18 -04:00
parent 91604fc6bb
commit 61790fa4b3

View file

@ -51,9 +51,14 @@ export async function swfetch(
requesturl.pathname.startsWith(this.config.prefix + "blob:") ||
requesturl.pathname.startsWith(this.config.prefix + "data:")
) {
let response: Response = await fetch(
requesturl.pathname.substring(this.config.prefix.length),
{
let dataurl = requesturl.pathname.substring(this.config.prefix.length);
if (dataurl.startsWith("blob:")) {
let origin = new URL(dataurl.substring("blob:".length));
dataurl = "blob:" + location.origin + origin.pathname;
console.log(dataurl);
}
let response: Response = await fetch(dataurl, {
// this is extremely redundant but i don't care
// method: request.method,
// body: request.body,
@ -64,8 +69,7 @@ export async function swfetch(
// redirect: "manual",
// //@ts-ignore
// duplex: "half",
}
);
});
let body: BodyType;