From 2d50e61403d0682ae4ada5bcef5c0d75e4f38aa5 Mon Sep 17 00:00:00 2001 From: Gian Breitenstein Date: Thu, 26 Sep 2024 18:49:17 +0200 Subject: [PATCH] changed character limit to backend --- main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.go b/main.go index a81eb7a..711d1d6 100644 --- a/main.go +++ b/main.go @@ -18,6 +18,11 @@ func main() { } func randomNumber(w http.ResponseWriter, r *http.Request) { name := r.URL.Query().Get("name") + if len(name) > 15 { + w.WriteHeader(400) + return + } + chance, err := strconv.Atoi(r.URL.Query().Get("chance")) if err != nil { w.WriteHeader(400)