Skip to content

Commit

Permalink
fix: turn on strict rewrites by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Percslol committed Oct 24, 2024
1 parent 5f70c1c commit c34d0a0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/client/shared/requests/beacon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { rewriteUrl } from "../../../shared";
import { ScramjetClient } from "../../client";

export default function (client: ScramjetClient, self) {
client.Proxy("navigator.sendBeacon", {
client.Proxy("Navigator.prototype.sendBeacon", {
apply(ctx) {
ctx.args[0] = rewriteUrl(ctx.args[0], client.meta);
},
Expand Down
12 changes: 0 additions & 12 deletions src/client/shared/requests/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ export default function (client: ScramjetClient, _self: typeof globalThis) {
},
});

// client.Proxy("Headers", {
// construct(ctx) {
// ctx.args[0] = rewriteHeaders(ctx.args[0]);
// },
// });

client.Proxy("Request", {
construct(ctx) {
if (typeof ctx.args[0] === "string" || ctx.args[0] instanceof URL) {
Expand All @@ -43,10 +37,4 @@ export default function (client: ScramjetClient, _self: typeof globalThis) {
return unrewriteUrl(ctx.get() as string);
},
});

// client.Proxy("Response.redirect", {
// apply(ctx) {
// ctx.args[0] = encodeUrl(ctx.args[0]);
// },
// });
}
2 changes: 1 addition & 1 deletion src/controller/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class ScramjetController {
serviceworkers: false,
naiiveRewriter: false,
captureErrors: true,
strictRewrites: false,
strictRewrites: true,
syncxhr: false,
cleanerrors: false,
scramitize: false,
Expand Down

0 comments on commit c34d0a0

Please sign in to comment.