尝试修复节点删除后仍可使用的BUG

This commit is contained in:
wyx2685 2023-11-21 04:13:14 +09:00
parent c1f36bb2ae
commit 330f3b1449
No known key found for this signature in database
GPG Key ID: 8827A30FF1DB1379

View File

@ -128,7 +128,7 @@ func (c *Client) GetNodeInfo() (node *NodeInfo, err error) {
SetHeader("If-None-Match", c.nodeEtag). SetHeader("If-None-Match", c.nodeEtag).
Get(path) Get(path)
if err = c.checkResponse(r, path, err); err != nil { if err = c.checkResponse(r, path, err); err != nil {
return return nil, err
} }
if r.StatusCode() == 304 { if r.StatusCode() == 304 {
return nil, nil return nil, nil
@ -238,9 +238,7 @@ func (c *Client) GetNodeInfo() (node *NodeInfo, err error) {
} }
case "dns": case "dns":
var domains []string var domains []string
for _, v := range matchs { domains = append(domains, matchs...)
domains = append(domains, v)
}
if matchs[0] != "main" { if matchs[0] != "main" {
node.RawDNS.DNSMap[strconv.Itoa(i)] = map[string]interface{}{ node.RawDNS.DNSMap[strconv.Itoa(i)] = map[string]interface{}{
"address": cm.Routes[i].ActionValue, "address": cm.Routes[i].ActionValue,
@ -249,7 +247,6 @@ func (c *Client) GetNodeInfo() (node *NodeInfo, err error) {
} else { } else {
dns := []byte(strings.Join(matchs[1:], "")) dns := []byte(strings.Join(matchs[1:], ""))
node.RawDNS.DNSJson = dns node.RawDNS.DNSJson = dns
break
} }
} }
} }