mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
dnsrecords: targets of srv records cannot be ip address
It's required by rfc spec and followed also by other players. coredns itself will choke SERVFAIL when serv.Key == ""
This commit is contained in:
@@ -84,7 +84,10 @@ func (man *SDnsRecordManager) ParseInputInfo(data *jsonutils.JSONDict) ([]string
|
||||
host := parts[0]
|
||||
if !regutils.MatchDomainName(host) &&
|
||||
!regutils.MatchIPAddr(host) {
|
||||
return "", httperrors.NewNotAcceptableError("SRV: invalid host part: %s", host)
|
||||
return "", httperrors.NewNotAcceptableError("SRV: target is not valid domain: %s", host)
|
||||
}
|
||||
if regutils.MatchIPAddr(host) {
|
||||
return "", httperrors.NewNotAcceptableError("SRV: target cannot be an IP address: %s", host)
|
||||
}
|
||||
port, err := strconv.Atoi(parts[1])
|
||||
if err != nil || port <= 0 || port >= 65536 {
|
||||
|
||||
Reference in New Issue
Block a user