mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 15:00:01 -04:00
fix url rewrites for blob worker
This commit is contained in:
parent
e359a3d600
commit
9b9905f640
1 changed files with 9 additions and 6 deletions
|
@ -17,13 +17,16 @@ export function encodeUrl(url: string | URL, origin?: URL) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!origin) {
|
if (!origin) {
|
||||||
origin = new URL(
|
if (location.pathname.startsWith(self.$scramjet.config.prefix + "worker")) {
|
||||||
self.$scramjet.config.codec.decode(
|
origin = new URL(new URL(location.href).searchParams.get("origin"));
|
||||||
location.href.slice(
|
} else
|
||||||
(location.origin + self.$scramjet.config.prefix).length
|
origin = new URL(
|
||||||
|
self.$scramjet.config.codec.decode(
|
||||||
|
location.href.slice(
|
||||||
|
(location.origin + self.$scramjet.config.prefix).length
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// is this the correct behavior?
|
// is this the correct behavior?
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue