fix data url workers

This commit is contained in:
velzie 2024-08-31 18:26:17 -04:00
parent 6ea474c3d0
commit ec0fb8b70a
No known key found for this signature in database
GPG key ID: 048413F95F0DDE1F
5 changed files with 75 additions and 43 deletions

View file

@ -1,4 +1,4 @@
import { encodeUrl, rewriteHeaders } from "../../../shared";
import { decodeUrl, encodeUrl, rewriteHeaders } from "../../../shared";
export default function (client, self) {
client.Proxy("XMLHttpRequest.prototype.open", {
@ -15,4 +15,10 @@ export default function (client, self) {
ctx.args = Object.entries(headerObject)[0];
},
});
client.Trap("XMLHttpRequest.prototype.responseURL", {
get(ctx) {
return decodeUrl(ctx.get());
},
});
}