diff --git a/proxychain/responsemodifers/rewriters/html_resource_url_rewriter.go b/proxychain/responsemodifers/rewriters/html_resource_url_rewriter.go index 31e8ffb..7579602 100644 --- a/proxychain/responsemodifers/rewriters/html_resource_url_rewriter.go +++ b/proxychain/responsemodifers/rewriters/html_resource_url_rewriter.go @@ -177,11 +177,7 @@ func injectScript(tokenBuffer *bytes.Buffer, script string) { func injectScriptWithParams(tokenBuffer *bytes.Buffer, script string, params map[string]string) { for old, new := range params { - script = strings.ReplaceAll( - script, - fmt.Sprintf("`${%s}`", old), - fmt.Sprintf("`${%s}`", new), - ) + script = strings.ReplaceAll(script, old, new) } tokenBuffer.WriteString( fmt.Sprintf("\n\n", script), diff --git a/proxychain/responsemodifers/rewriters/js_resource_url_rewriter.js b/proxychain/responsemodifers/rewriters/js_resource_url_rewriter.js index 0562ba0..880e7ac 100644 --- a/proxychain/responsemodifers/rewriters/js_resource_url_rewriter.js +++ b/proxychain/responsemodifers/rewriters/js_resource_url_rewriter.js @@ -28,13 +28,13 @@ // don't double rewrite //const proxyOrigin = globalThis.window.location.origin; - const proxyOrigin = `${PROXY_ORIGIN_INJECT_FROM_GOLANG}`; + const proxyOrigin = `PROXY_ORIGIN_INJECT_FROM_GOLANG`; if (url.startsWith(proxyOrigin)) return url; if (url.startsWith(`/${proxyOrigin}`)) return url; if (url.startsWith(`/${origin}`)) return url; //const origin = (new URL(decodeURIComponent(globalThis.window.location.pathname.substring(1)))).origin - const origin = `${ORIGIN_INJECT_FROM_GOLANG}`; + const origin = `ORIGIN_INJECT_FROM_GOLANG`; //console.log(`proxychain: origin: ${origin} // proxyOrigin: ${proxyOrigin} // original: ${oldUrl}`) if (url.startsWith("//")) {