修改*号的含义

This commit is contained in:
xljiulang 2021-07-22 21:02:16 +08:00
parent 436e7cb398
commit 2850f30516
2 changed files with 3 additions and 2 deletions

View File

@ -5,6 +5,7 @@ namespace FastGithub
{
/// <summary>
/// 域名匹配
/// *表示除.之外任意0到多个字符
/// </summary>
public class DomainMatch : IComparable<DomainMatch>
{
@ -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);
}

View File

@ -8,7 +8,7 @@
"IPAddress": "114.114.114.114",
"Port": 53
},
"DomainConfigs": { // *0
"DomainConfigs": { // *.0
"github.com": {
"TlsSni": false, // tlsSNI
"TlsSniPattern": null, // SNI@domain @ipadressip @random