属性名重命名

This commit is contained in:
xljiulang 2021-07-17 21:42:33 +08:00
parent 92ce30af09
commit 9e798f0c94
3 changed files with 10 additions and 10 deletions

View File

@ -8,16 +8,16 @@ namespace FastGithub
sealed class DomainMatch
{
private readonly Regex regex;
private readonly string pattern;
private readonly string domainPattern;
/// <summary>
/// 域名匹配
/// </summary>
/// <param name="pattern">域名表达式</param>
public DomainMatch(string pattern)
/// <param name="domainPattern">域名表达式</param>
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
/// <returns></returns>
public override string ToString()
{
return this.pattern;
return this.domainPattern;
}
}
}

View File

@ -28,9 +28,9 @@ namespace FastGithub
public IPEndPointOptions UntrustedDns { get; set; } = new IPEndPointOptions { IPAddress = "114.114.114.114", Port = 53 };
/// <summary>
/// 代理的域名匹配
/// 代理的域名表达式
/// </summary>
public HashSet<string> DomainMatches { get; set; } = new();
public HashSet<string> DomainPatterns { get; set; } = new();
/// <summary>
/// 验证选项值
@ -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();
}

View File

@ -8,7 +8,7 @@
"IPAddress": "114.114.114.114",
"Port": 53
},
"DomainMatches": [ // *0
"DomainPatterns": [ // *0
"github.com",
"githubstatus.com",
"*.github.com",