mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 15:00:01 -04:00
fix: proxy more cache apis and fix proxy
This commit is contained in:
parent
0503b3a408
commit
b09b3c1d0d
1 changed files with 14 additions and 2 deletions
|
@ -41,7 +41,7 @@ export default function (client: ScramjetClient, self: typeof globalThis) {
|
|||
},
|
||||
});
|
||||
|
||||
client.Proxy("Cache.prototype.delete", {
|
||||
client.Proxy("Cache.prototype.put", {
|
||||
apply(ctx) {
|
||||
ctx.args[0] = rewriteUrl(ctx.args[0], client.meta);
|
||||
},
|
||||
|
@ -55,7 +55,19 @@ export default function (client: ScramjetClient, self: typeof globalThis) {
|
|||
|
||||
client.Proxy("Cache.prototype.matchAll", {
|
||||
apply(ctx) {
|
||||
if (ctx.args[0]) ctx.args[0] = `${client.url.origin}@${ctx.args[0]}`;
|
||||
if (ctx.args[0]) ctx.args[0] = rewriteUrl(ctx.args[0], client.meta);
|
||||
},
|
||||
});
|
||||
|
||||
client.Proxy("Cache.prototype.keys", {
|
||||
apply(ctx) {
|
||||
if (ctx.args[0]) ctx.args[0] = rewriteUrl(ctx.args[0], client.meta);
|
||||
},
|
||||
});
|
||||
|
||||
client.Proxy("Cache.prototype.delete", {
|
||||
apply(ctx) {
|
||||
ctx.args[0] = rewriteUrl(ctx.args[0], client.meta);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue