From e73b2a9fb9db82ea5dd1a1a5d554a585188b6b21 Mon Sep 17 00:00:00 2001 From: nblock Date: Tue, 24 Jun 2025 14:45:44 +0200 Subject: [PATCH] Ensure that a username starts with a letter (#2635) --- hscontrol/util/dns.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hscontrol/util/dns.go b/hscontrol/util/dns.go index f2938a8c..3a08fc3a 100644 --- a/hscontrol/util/dns.go +++ b/hscontrol/util/dns.go @@ -37,9 +37,9 @@ func ValidateUsername(username string) error { return errors.New("username must be at least 2 characters long") } - // Ensure the username does not start with a number - if unicode.IsDigit(rune(username[0])) { - return errors.New("username cannot start with a number") + // Ensure the username starts with a letter + if !unicode.IsLetter(rune(username[0])) { + return errors.New("username must start with a letter") } atCount := 0