From 42224a4bf075d5f7cb6986875dff06ec3e8bab26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com> Date: Mon, 7 Apr 2025 15:19:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20proxy=E5=92=8Credirect=E6=8B=A6?= =?UTF-8?q?=E6=88=AA=E5=99=A8=EF=BC=8C=E6=94=AF=E6=8C=81=E5=91=BD=E5=90=8D?= =?UTF-8?q?=E6=8D=95=E8=8E=B7=E7=BB=84=E5=90=8D=E7=A7=B0=E6=9D=A5=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=8D=A0=E4=BD=8D=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/mitmproxy/src/lib/interceptor/impl/req/proxy.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/mitmproxy/src/lib/interceptor/impl/req/proxy.js b/packages/mitmproxy/src/lib/interceptor/impl/req/proxy.js index f558471..a6d59a4 100644 --- a/packages/mitmproxy/src/lib/interceptor/impl/req/proxy.js +++ b/packages/mitmproxy/src/lib/interceptor/impl/req/proxy.js @@ -11,6 +11,11 @@ function replacePlaceholder (url, rOptions, matched) { for (let i = 0; i < matched.length; i++) { url = url.replace(`\${m[${i}]}`, matched[i] == null ? '' : matched[i]) } + if (matched.groups) { + for (const key in matched.groups) { + url = url.replace(`\${${key}}`, matched.groups[key] == null ? '' : matched.groups[key]) + } + } } // 移除多余的占位符