From 9b13575ba1f66f01cda30667ce7305ab86fb2553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com> Date: Thu, 17 Oct 2024 16:01:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=BF=97=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/mitmproxy/src/utils/util.match.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/mitmproxy/src/utils/util.match.js b/packages/mitmproxy/src/utils/util.match.js index 1913be0..14d69aa 100644 --- a/packages/mitmproxy/src/utils/util.match.js +++ b/packages/mitmproxy/src/utils/util.match.js @@ -62,17 +62,17 @@ function matchHostname (hostMap, hostname, action) { // 域名快速匹配:直接匹配 或者 两种前缀通配符匹配 let value = hostMap.origin[hostname] if (value) { - log.info(`matchHostname: ${action}: '${hostname}' -> '${hostname}': ${JSON.stringify(value)}`) + log.info(`matchHostname: ${action}: '${hostname}' -> { "${hostname}": ${JSON.stringify(value)} }`) return value // 快速匹配成功 } value = hostMap.origin['*' + hostname] if (value) { - log.info(`matchHostname: ${action}: '${hostname}' -> '*${hostname}': ${JSON.stringify(value)}`) + log.info(`matchHostname: ${action}: '${hostname}' -> { "*${hostname}": ${JSON.stringify(value)} }`) return value // 快速匹配成功 } value = hostMap.origin['*.' + hostname] if (value) { - log.info(`matchHostname: ${action}: '${hostname}' -> '*.${hostname}': ${JSON.stringify(value)}`) + log.info(`matchHostname: ${action}: '${hostname}' -> { "*.${hostname}": ${JSON.stringify(value)} }`) return value // 快速匹配成功 } @@ -145,7 +145,7 @@ function matchHostnameAll (hostMap, hostname, action) { // 正则表达式匹配 if (hostname.match(regexp)) { value = hostMap[target] - log.debug(`matchHostname-one: ${action}: '${hostname}' -> '${target}': ${JSON.stringify(value)}`) + log.debug(`matchHostname-one: ${action}: '${hostname}' -> { "${target}": ${JSON.stringify(value)} }`) values = merge(values, value) } } @@ -154,19 +154,19 @@ function matchHostnameAll (hostMap, hostname, action) { // 优先级:2 value = hostMap.origin['*' + hostname] if (value) { - log.debug(`matchHostname-one: ${action}: '${hostname}' -> '*${hostname}': ${JSON.stringify(value)}`) + log.debug(`matchHostname-one: ${action}: '${hostname}' -> { "*${hostname}": ${JSON.stringify(value)} }`) values = merge(values, value) } // 优先级:3 value = hostMap.origin['*.' + hostname] if (value) { - log.debug(`matchHostname-one: ${action}: '${hostname}' -> '*.${hostname}': ${JSON.stringify(value)}`) + log.debug(`matchHostname-one: ${action}: '${hostname}' -> { "*.${hostname}": ${JSON.stringify(value)} }`) values = merge(values, value) } // 优先级:4,最高(注:优先级高的配置,可以覆盖优先级低的配置,甚至有空配置时,可以移除已有配置) value = hostMap.origin[hostname] if (value) { - log.debug(`matchHostname-one: ${action}: '${hostname}' -> '${hostname}': ${JSON.stringify(value)}`) + log.debug(`matchHostname-one: ${action}: '${hostname}' -> { "${hostname}": ${JSON.stringify(value)} }`) values = merge(values, value) }