improve ruleset unmarshalling behavior if there isnt a top level rule key

This commit is contained in:
Kevin Pham
2023-12-09 08:37:23 -06:00
parent 27c3892b0b
commit 22533dc739
6 changed files with 58 additions and 6 deletions

View File

@@ -52,6 +52,19 @@ func PatchDynamicResourceURLs() proxychain.ResponseModification {
htmlRewriter := rewriters.NewHTMLRewriter(chain.Response.Body, rr)
chain.Response.Body = htmlRewriter
// window.location
/*
spoofedLocationAPI := fmt.Sprintf(`{href:"%s", origin:"%s", pathname:"%s", protocol:"%s:", port:"%s"}`,
reqURL.String(), reqURL.Host,
reqURL.Path, reqURL.Scheme, reqURL.Port())
spoofedLocationAPI := fmt.Sprintf(`{origin: "%s"}`, reqURL.Host)
fmt.Println(spoofedLocationAPI)
chain.AddOnceResponseModifications(
ModifyIncomingScriptsWithRegex(`window\.location`, spoofedLocationAPI),
)
*/
return nil
}
}