diff --git a/web/server.go b/web/server.go index c49349d..41b8e16 100644 --- a/web/server.go +++ b/web/server.go @@ -13,6 +13,7 @@ import ( "encoding/pem" "fmt" "io/fs" + "io/ioutil" "log" "log/slog" "math/big" @@ -1817,6 +1818,17 @@ func (s *Server) handleRerunHeat() http.HandlerFunc { // handleSetRacingGroup sets the currently racing group func (s *Server) handleSetRacingGroup() http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { + body, err := ioutil.ReadAll(r.Body) + if err != nil { + http.Error(w, "Failed to read request body", http.StatusBadRequest) + return + } + defer r.Body.Close() + + // Process the plain text body + text := string(body) + s.logger.Info("Set racing group request", "text", text) + // Parse request body var request struct { GroupID int64 `json:"group_id"`