From 78167a8955108960fef178db86873c5f315d358d Mon Sep 17 00:00:00 2001 From: mytja Date: Mon, 1 Jan 2024 01:53:29 +0100 Subject: [PATCH] set handle minimum size --- backend/internal/httphandlers/auth.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/internal/httphandlers/auth.go b/backend/internal/httphandlers/auth.go index 256824d..161214b 100644 --- a/backend/internal/httphandlers/auth.go +++ b/backend/internal/httphandlers/auth.go @@ -114,6 +114,11 @@ func (s *httpImpl) Registration(w http.ResponseWriter, r *http.Request) { } handle = strings.ToLower(handle) + if len(handle) <= 2 { + w.WriteHeader(http.StatusBadRequest) + return + } + for i := 0; i < len(handle); i++ { c := rune(handle[i]) if !helpers.Contains(AVAILABLE_HANDLE_CHARS, c) {