[chore]: Bump github.com/miekg/dns from 1.1.55 to 1.1.56 (#2204)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
dependabot[bot]
2023-09-18 13:45:20 +01:00
committed by GitHub
parent ba0a31d224
commit f302ebb8e5
31 changed files with 1638 additions and 1966 deletions

View File

@ -5,6 +5,7 @@ import (
"net"
"strconv"
"strings"
"unicode"
)
const hexDigit = "0123456789abcdef"
@ -330,8 +331,18 @@ func Fqdn(s string) string {
// CanonicalName returns the domain name in canonical form. A name in canonical
// form is lowercase and fully qualified. See Section 6.2 in RFC 4034.
// According to the RFC all uppercase US-ASCII letters in the owner name of the
// RR areeplaced by the corresponding lowercase US-ASCII letters.
func CanonicalName(s string) string {
return strings.ToLower(Fqdn(s))
var result strings.Builder
for _, ch := range s {
if unicode.IsUpper(ch) && (ch >= 0x00 && ch <= 0x7F) {
result.WriteRune(unicode.ToLower(ch))
} else {
result.WriteRune(ch)
}
}
return Fqdn(result.String())
}
// Copied from the official Go code.