Cosmetic improvement

This commit is contained in:
Taras Kushnir
2025-09-03 21:22:41 +03:00
parent 975d2dd17c
commit b7dc45bc80

View File

@@ -250,6 +250,12 @@ func (s *Server) puzzleHandler(w http.ResponseWriter, r *http.Request) {
func (s *Server) recaptchaVerifyHandler(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
if err := r.ParseForm(); err != nil {
slog.ErrorContext(ctx, "Failed to read request form", common.ErrAttr(err))
http.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)
return
}
data := r.FormValue(common.ParamResponse)
if len(data) == 0 {
slog.ErrorContext(ctx, "Empty captcha response")