1
0
mirror of https://github.com/taigrr/godns synced 2025-01-18 04:03:25 -08:00

fix: DNSPod handler issue for checking IPv4/IPv6

This commit is contained in:
Timothy 2020-10-01 18:28:31 +08:00
parent e33cd6e1cb
commit 7a60d3415f
No known key found for this signature in database
GPG Key ID: DA25A2861AA0F2D1

View File

@ -177,6 +177,15 @@ func (handler *Handler) GetSubDomain(domainID int64, name string) (string, strin
value.Add("length", "1")
value.Add("sub_domain", name)
if handler.Configuration.IPType == "" || strings.ToUpper(handler.Configuration.IPType) == godns.IPV4 {
value.Add("record_type", "A")
} else if strings.ToUpper(handler.Configuration.IPType) == godns.IPV6 {
value.Add("record_type", "AAAA")
} else {
log.Println("Error: must specify \"ip_type\" in config for DNSPod.")
return "", ""
}
response, err := handler.PostData("/Record.List", value)
if err != nil {