From 9e798f0c940617e3e06f666a27b1da88c85093ad Mon Sep 17 00:00:00 2001 From: xljiulang <366193849@qq.com> Date: Sat, 17 Jul 2021 21:42:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=9E=E6=80=A7=E5=90=8D=E9=87=8D=E5=91=BD?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FastGithub.Core/DomainMatch.cs | 12 ++++++------ FastGithub.Core/FastGithubOptions.cs | 6 +++--- FastGithub/appsettings.json | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/FastGithub.Core/DomainMatch.cs b/FastGithub.Core/DomainMatch.cs index c5215e1..3e93c08 100644 --- a/FastGithub.Core/DomainMatch.cs +++ b/FastGithub.Core/DomainMatch.cs @@ -8,16 +8,16 @@ namespace FastGithub sealed class DomainMatch { private readonly Regex regex; - private readonly string pattern; + private readonly string domainPattern; /// /// 域名匹配 /// - /// 域名表达式 - public DomainMatch(string pattern) + /// 域名表达式 + public DomainMatch(string domainPattern) { - this.pattern = pattern; - var regexPattern = Regex.Escape(pattern).Replace(@"\*", ".*"); + this.domainPattern = domainPattern; + var regexPattern = Regex.Escape(domainPattern).Replace(@"\*", ".*"); this.regex = new Regex($"^{regexPattern}$", RegexOptions.IgnoreCase); } @@ -37,7 +37,7 @@ namespace FastGithub /// public override string ToString() { - return this.pattern; + return this.domainPattern; } } } diff --git a/FastGithub.Core/FastGithubOptions.cs b/FastGithub.Core/FastGithubOptions.cs index db884a1..8afe5c1 100644 --- a/FastGithub.Core/FastGithubOptions.cs +++ b/FastGithub.Core/FastGithubOptions.cs @@ -28,9 +28,9 @@ namespace FastGithub public IPEndPointOptions UntrustedDns { get; set; } = new IPEndPointOptions { IPAddress = "114.114.114.114", Port = 53 }; /// - /// 代理的域名匹配 + /// 代理的域名表达式 /// - public HashSet DomainMatches { get; set; } = new(); + public HashSet DomainPatterns { get; set; } = new(); /// /// 验证选项值 @@ -40,7 +40,7 @@ namespace FastGithub { this.trustedDnsEndPoint = this.TrustedDns.ToIPEndPoint(); this.unTrustedDnsEndPoint = this.UntrustedDns.ToIPEndPoint(); - this.domainMatches = this.DomainMatches.Select(item => new DomainMatch(item)).ToArray(); + this.domainMatches = this.DomainPatterns.Select(item => new DomainMatch(item)).ToArray(); } diff --git a/FastGithub/appsettings.json b/FastGithub/appsettings.json index 5d8913b..3e75f2e 100644 --- a/FastGithub/appsettings.json +++ b/FastGithub/appsettings.json @@ -8,7 +8,7 @@ "IPAddress": "114.114.114.114", "Port": 53 }, - "DomainMatches": [ // *ʾ0ַ + "DomainPatterns": [ // *ʾ0ַ "github.com", "githubstatus.com", "*.github.com",