From 2850f30516c41db90531044fd709df234941c82c Mon Sep 17 00:00:00 2001
From: xljiulang <366193849@qq.com>
Date: Thu, 22 Jul 2021 21:02:16 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9*=E5=8F=B7=E7=9A=84=E5=90=AB?=
=?UTF-8?q?=E4=B9=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
FastGithub.Core/DomainMatch.cs | 3 ++-
FastGithub/appsettings.json | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/FastGithub.Core/DomainMatch.cs b/FastGithub.Core/DomainMatch.cs
index 9ec1928..f5fc0d9 100644
--- a/FastGithub.Core/DomainMatch.cs
+++ b/FastGithub.Core/DomainMatch.cs
@@ -5,6 +5,7 @@ namespace FastGithub
{
///
/// 域名匹配
+ /// *表示除.之外任意0到多个字符
///
public class DomainMatch : IComparable
{
@@ -18,7 +19,7 @@ namespace FastGithub
public DomainMatch(string domainPattern)
{
this.domainPattern = domainPattern;
- var regexPattern = Regex.Escape(domainPattern).Replace(@"\*", ".*");
+ var regexPattern = Regex.Escape(domainPattern).Replace(@"\*", @"[^\.]*");
this.regex = new Regex($"^{regexPattern}$", RegexOptions.IgnoreCase);
}
diff --git a/FastGithub/appsettings.json b/FastGithub/appsettings.json
index ecf9c65..890ef88 100644
--- a/FastGithub/appsettings.json
+++ b/FastGithub/appsettings.json
@@ -8,7 +8,7 @@
"IPAddress": "114.114.114.114",
"Port": 53
},
- "DomainConfigs": { // 域名的*表示0到多个任意字符
+ "DomainConfigs": { // 域名的*表示除.之外0到多个任意字符
"github.com": {
"TlsSni": false, // 指示tls握手时是否发送SNI
"TlsSniPattern": null, // SNI表达式,@domain变量表示取域名值 @ipadress变量表示取ip @random变量表示取随机值,其它字符保留不替换