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 + "blob:") ||
requesturl.pathname.startsWith(this.config.prefix + "data:") requesturl.pathname.startsWith(this.config.prefix + "data:")
) { ) {
let response: Response = await fetch( let dataurl = requesturl.pathname.substring(this.config.prefix.length);
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 // this is extremely redundant but i don't care
// method: request.method, // method: request.method,
// body: request.body, // body: request.body,
@ -64,8 +69,7 @@ export async function swfetch(
// redirect: "manual", // redirect: "manual",
// //@ts-ignore // //@ts-ignore
// duplex: "half", // duplex: "half",
} });
);
let body: BodyType; let body: BodyType;