Browse Source

bugfix: 当某个域名未配置拦截配置,但启动了彩蛋功能时,彩蛋功能失效的问题修复

pull/377/head v1.8.7
王良 1 month ago
parent
commit
b8945e3768
  1. 5
      packages/mitmproxy/src/lib/proxy/middleware/overwall.js

5
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__'

Loading…
Cancel
Save