From b8945e37685c5ca1de8c3d8a0a6c02982332ebc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com> Date: Fri, 18 Oct 2024 00:48:36 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=20=E5=BD=93=E6=9F=90=E4=B8=AA=E5=9F=9F?= =?UTF-8?q?=E5=90=8D=E6=9C=AA=E9=85=8D=E7=BD=AE=E6=8B=A6=E6=88=AA=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=EF=BC=8C=E4=BD=86=E5=90=AF=E5=8A=A8=E4=BA=86=E5=BD=A9?= =?UTF-8?q?=E8=9B=8B=E5=8A=9F=E8=83=BD=E6=97=B6=EF=BC=8C=E5=BD=A9=E8=9B=8B?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=A4=B1=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/mitmproxy/src/lib/proxy/middleware/overwall.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/mitmproxy/src/lib/proxy/middleware/overwall.js b/packages/mitmproxy/src/lib/proxy/middleware/overwall.js index a1ab44e..72f0aa6 100644 --- a/packages/mitmproxy/src/lib/proxy/middleware/overwall.js +++ b/packages/mitmproxy/src/lib/proxy/middleware/overwall.js @@ -152,6 +152,9 @@ function createOverwallMiddleware (overWallConfig) { if (ret == null) { return null // 返回 null,由下一个拦截器校验 } + if (ret === false) { + return false // 不拦截,预留这个判断,避免以后修改 matched 方法的代码出BUG + } return true // 拦截 }, requestIntercept (context, req, res, ssl, next) { @@ -161,7 +164,7 @@ function createOverwallMiddleware (overWallConfig) { } const hostname = rOptions.hostname const matchedResult = matched(hostname, overWallTargetMap) - if (matchedResult == null) { + if (matchedResult == null || matchedResult === false) { return } const cacheKey = '__over_wall_proxy__'