小调整。

pull/448/head
王良 2025-02-07 11:42:29 +08:00
parent 73ada64485
commit 43304e850c
1 changed files with 4 additions and 0 deletions

View File

@ -32,6 +32,10 @@ function domainMapRegexply (hostMap) {
const regexpMap = {}
const origin = {} // 用于快速匹配见matchHostname、matchHostnameAll方法
lodash.each(hostMap, (value, domain) => {
if (lodash.isEmpty(value)) {
return
}
// 将域名匹配串格式如 `.xxx.com` 转换为 `*.xxx.com`
if (domain[0] === '.' && lodash.isEmpty(hostMap[`*${domain}`])) {
domain = `*${domain}`