mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-16 07:30:02 -04:00
fix workers
This commit is contained in:
parent
0939dd2b57
commit
5f7a9d4bd4
5 changed files with 14 additions and 11 deletions
|
@ -111,6 +111,7 @@ export class ScramjetServiceWorker {
|
|||
async fetch({ request, clientId }: FetchEvent) {
|
||||
if (new URL(request.url).pathname.startsWith("/scramjet/worker")) {
|
||||
const dataurl = new URL(request.url).searchParams.get("data");
|
||||
const type = new URL(request.url).searchParams.get("type");
|
||||
const res = await fetch(dataurl);
|
||||
const ab = await res.arrayBuffer();
|
||||
|
||||
|
@ -118,7 +119,7 @@ export class ScramjetServiceWorker {
|
|||
decodeURIComponent(new URL(request.url).searchParams.get("origin"))
|
||||
);
|
||||
|
||||
const rewritten = rewriteWorkers(ab, new URL(origin));
|
||||
const rewritten = rewriteWorkers(ab, type, new URL(origin));
|
||||
|
||||
return new Response(rewritten, {
|
||||
headers: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue