Skip to content

Commit

Permalink
validators: Allow PTR DNS records
Browse files Browse the repository at this point in the history
Update the `validateRecordType` to allow defining PTR record types.

Closes cloudflare#283
  • Loading branch information
jacobbednarz committed Apr 7, 2019
1 parent 0f5e332 commit 2bb8343
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cloudflare/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ func validateRecordType(t string, proxied bool) error {
switch t {
case "A", "AAAA", "CNAME":
return nil
case "TXT", "SRV", "LOC", "MX", "NS", "SPF", "CAA", "CERT", "DNSKEY", "DS", "NAPTR", "SMIMEA", "SSHFP", "TLSA", "URI":
case "TXT", "SRV", "LOC", "MX", "NS", "SPF", "CAA", "CERT", "DNSKEY", "DS", "NAPTR", "SMIMEA", "SSHFP", "TLSA", "URI", "PTR":
if !proxied {
return nil
}
default:
return fmt.Errorf(
`Invalid type %q. Valid types are "A", "AAAA", "CNAME", "TXT", "SRV", "LOC", "MX", "NS", "SPF", "CAA", "CERT", "DNSKEY", "DS", "NAPTR", "SMIMEA", "SSHFP", "TLSA" or "URI".`, t)
`Invalid type %q. Valid types are "A", "AAAA", "CNAME", "TXT", "SRV", "LOC", "MX", "NS", "SPF", "CAA", "CERT", "DNSKEY", "DS", "NAPTR", "SMIMEA", "SSHFP", "TLSA", "URI" or "PTR.`, t)
}

return fmt.Errorf("Type %q cannot be proxied", t)
Expand Down

0 comments on commit 2bb8343

Please sign in to comment.