whistle.mock-plugins 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/rules-server.js +1 -2
- package/package.json +1 -1
package/lib/rules-server.js
CHANGED
|
@@ -117,7 +117,6 @@ const loadInterfaces = () => {
|
|
|
117
117
|
// 匹配URL是否符合模式
|
|
118
118
|
const isUrlMatch = (url, pattern, proxyType, fullUrl) => {
|
|
119
119
|
if (!pattern) return false;
|
|
120
|
-
|
|
121
120
|
try {
|
|
122
121
|
// 针对不同的代理类型采用不同的匹配策略
|
|
123
122
|
|
|
@@ -151,7 +150,7 @@ const isUrlMatch = (url, pattern, proxyType, fullUrl) => {
|
|
|
151
150
|
}
|
|
152
151
|
|
|
153
152
|
// 正则表达式匹配
|
|
154
|
-
if (pattern.startsWith('/')
|
|
153
|
+
if (pattern.startsWith('/')) {
|
|
155
154
|
const regexStr = pattern.slice(1, -1);
|
|
156
155
|
const regex = new RegExp(regexStr);
|
|
157
156
|
return regex.test(url);
|