properly proxy worker postmessae

This commit is contained in:
velzie 2024-09-02 16:21:48 -04:00
parent 35eb307d4d
commit 4f5ae7b18a
No known key found for this signature in database
GPG key ID: 048413F95F0DDE1F
4 changed files with 36 additions and 5 deletions

View file

@ -23,6 +23,8 @@ export default function (client: ScramjetClient, self: Self) {
return this.ports;
},
source() {
if (this.source === null) return null;
const scram: ScramjetClient = this.source[SCRAMJETCLIENT];
if (scram) return scram.globalProxy;
@ -33,7 +35,6 @@ export default function (client: ScramjetClient, self: Self) {
if (typeof this.data === "object" && "$scramjet$origin" in this.data)
return this.data.$scramjet$origin;
// then it must be from a worker, which we aren't currently rewriting
return client.url.origin;
},
data() {