rule: allow to use root domains like com/net/cn... #43

This commit is contained in:
nadoo committed 2019-03-07 00:19:30 +08:00
1 parent 8c922db612
commit f9a21f5951
5 files changed
+12 -6

No files matched your search

+1 -1
View File
@@ -219,7 +219,7 @@ func (c *Client) SetServers(domain string, servers ...string) {
func (c *Client) GetServers(domain string) []string {
domainParts := strings.Split(domain, ".")
length := len(domainParts)
for i := length - 2; i >= 0; i-- {
for i := length - 1; i >= 0; i-- {
domain := strings.Join(domainParts[i:length], ".")
if servers, ok := c.upServerMap[domain]; ok {