mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 06:50: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) {
|
||||
origin = new URL(
|
||||
self.$scramjet.config.codec.decode(
|
||||
location.href.slice(
|
||||
(location.origin + self.$scramjet.config.prefix).length
|
||||
if (location.pathname.startsWith(self.$scramjet.config.prefix + "worker")) {
|
||||
origin = new URL(new URL(location.href).searchParams.get("origin"));
|
||||
} else
|
||||
origin = new URL(
|
||||
self.$scramjet.config.codec.decode(
|
||||
location.href.slice(
|
||||
(location.origin + self.$scramjet.config.prefix).length
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
// is this the correct behavior?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue