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变量表示取随机值,其它字符保留不替换