From ed52dafeb3995775ca469d7d860217fff5ed42ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com> Date: Sat, 28 Sep 2024 22:37:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=B9=E9=85=8D=E6=96=B9=E6=B3=95=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/mitmproxy/src/utils/util.match.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/mitmproxy/src/utils/util.match.js b/packages/mitmproxy/src/utils/util.match.js index 29db2dbb..f922add6 100644 --- a/packages/mitmproxy/src/utils/util.match.js +++ b/packages/mitmproxy/src/utils/util.match.js @@ -2,6 +2,10 @@ const lodash = require('lodash') const log = require('./util.log') function isMatched (url, regexp) { + if (regexp === true || regexp === 'true') { + return true + } + try { let urlRegexp = regexp if (regexp[0] === '*' || regexp[0] === '?' || regexp[0] === '+') { @@ -15,7 +19,7 @@ function isMatched (url, regexp) { } function domainRegexply (target) { - if (target === '.*') { + if (target === '.*' || target === '*' || target === 'true') { return '^.*$' } return '^' + target.replace(/\./g, '\\.').replace(/\*/g, '.*') + '$'