1.1.1 -> 1.1.2 第13次更新

This commit is contained in:
Space Time 2024-10-02 02:17:49 +08:00
parent 7e85989fa8
commit a25f0a9b6d

View File

@ -195,7 +195,14 @@ public partial class MainWin : Window
string hostIp = string.IsNullOrWhiteSpace(hostItem[2].ToString()) ? "127.0.0.1" : hostItem[2].ToString(); string hostIp = string.IsNullOrWhiteSpace(hostItem[2].ToString()) ? "127.0.0.1" : hostItem[2].ToString();
foreach (JsonElement hostDomain in hostItem[0].EnumerateArray()) foreach (JsonElement hostDomain in hostItem[0].EnumerateArray())
hostRulesFragments += $"MAP {hostDomain} {hostSni},"; {
if (hostDomain.ToString().StartsWith('^') || hostDomain.ToString().EndsWith('^'))
continue;
string[] hostDomainPair = hostDomain.ToString().Split('^', 2);
hostRulesFragments += $"MAP {hostDomainPair[0]} {hostSni}," + (hostDomainPair.Length == 2 ? $"EXCLUDE {hostDomainPair[1]}," : string.Empty);
}
hostResolverRulesFragments += $"MAP {hostSni} {hostIp},"; hostResolverRulesFragments += $"MAP {hostSni} {hostIp},";