Skip to content

Commit

Permalink
fix: the domain name separation does not work well (#625)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeessy2 authored Mar 13, 2023
1 parent 2f58c51 commit ee2d205
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions web/save.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,22 @@ func checkAndSave(request *http.Request) string {
dnsConf.Ipv4.URL = strings.TrimSpace(v.Ipv4Url)
dnsConf.Ipv4.NetInterface = v.Ipv4NetInterface
dnsConf.Ipv4.Cmd = strings.TrimSpace(v.Ipv4Cmd)
dnsConf.Ipv4.Domains = strings.Split(v.Ipv4Domains, "\r\n")
if strings.Contains(v.Ipv4Domains, "\r\n") {
dnsConf.Ipv4.Domains = strings.Split(v.Ipv4Domains, "\r\n")
} else {
dnsConf.Ipv4.Domains = strings.Split(v.Ipv4Domains, "\n")
}
dnsConf.Ipv6.Enable = v.Ipv6Enable == "on"
dnsConf.Ipv6.GetType = v.Ipv6GetType
dnsConf.Ipv6.URL = strings.TrimSpace(v.Ipv6Url)
dnsConf.Ipv6.NetInterface = v.Ipv6NetInterface
dnsConf.Ipv6.Cmd = strings.TrimSpace(v.Ipv6Cmd)
dnsConf.Ipv6.IPv6Reg = strings.TrimSpace(v.IPv6Reg)
dnsConf.Ipv6.Domains = strings.Split(v.Ipv6Domains, "\r\n")
if strings.Contains(v.Ipv6Domains, "\r\n") {
dnsConf.Ipv6.Domains = strings.Split(v.Ipv6Domains, "\r\n")
} else {
dnsConf.Ipv6.Domains = strings.Split(v.Ipv6Domains, "\n")
}

ipCmd := [...]string{"", ""}
if k < len(conf.DnsConf) {
Expand Down

0 comments on commit ee2d205

Please sign in to comment.