validateDomain runs the IDNA "Lookup" profile against a user-supplied domain string. Lookup is the strictest of the four IDNA profiles and is what DNS resolvers themselves apply when converting a name into a wire-format query — it rejects whitespace, control characters, invalid label combinations, a
(domain string)
| 1551 | // instead of replicating the security-relevant parsing. Returns the |
| 1552 | // normalized (Punycode) form. |
| 1553 | func ValidateDomain(domain string) (string, error) { |
| 1554 | return validateDomain(domain) |
| 1555 | } |
| 1556 | |
| 1557 | func validateDomain(domain string) (string, error) { |
| 1558 | if domain == "" { |
no test coverage detected