внес правки

This commit is contained in:
2026-10-23 00:00:08 +03:00
parent 3695ab6dfa
commit 2ebebda388
9 changed files with 217 additions and 44 deletions
+1 -6
View File
@@ -4,7 +4,6 @@ import (
"errors"
"net/http"
"regexp"
"strings"
"unicode/utf8"
"golang.org/x/sync/singleflight"
@@ -64,11 +63,7 @@ func (a *api) authMiddleware(next func(w http.ResponseWriter, r *http.Request, u
}
func validDisplayName(s string) bool {
if strings.TrimSpace(s) == "" {
return false
}
n := utf8.RuneCountInString(s)
return n >= 1 && n <= 100
return validText(s, 100)
}
func validPassword(s string) bool {