allow domain labels with no minimum length

This commit is contained in:
jimmyGALLAND
2025-10-02 12:42:13 +02:00
parent 2140e5b0b5
commit 030ef2e01c

View File

@@ -126,7 +126,6 @@ func CertExpireSoon(certBytes []byte, numberOfDays int) bool {
// * Each label ≤ 63 characters
// * Only letters, digits, and hyphens
// * Labels do not start or end with a hyphen
// * Labels must have >= 2 characters
// * Full domain ≤ 253 characters
// Returns an empty string if the domain is invalid.
func NormalizeDomain(d string) (string, error) {
@@ -146,9 +145,6 @@ func NormalizeDomain(d string) (string, error) {
if len(label) == 0 {
return "", errors.New("Domain '" + d + "' not valid: Empty label")
}
if len(label) < 2 {
return "", errors.New("Domain '" + d + "' not valid: label '" + label + "' is too short")
}
if len(label) > 63 {
return "", errors.New("Domain not valid: label exceeds 63 characters")
}