From d5e9246112daca527527b1eac3a944c7380932fe Mon Sep 17 00:00:00 2001 From: Giovanni Harting <539@idlegandalf.com> Date: Fri, 8 Oct 2021 21:04:09 +0200 Subject: [PATCH] return after writing header --- main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.go b/main.go index ba838bd..ee4f869 100644 --- a/main.go +++ b/main.go @@ -340,6 +340,7 @@ func getMatch(w http.ResponseWriter, r *http.Request) { if err != nil { log.Warningf("[GM] match %d not found: %+v", matchId, err) w.WriteHeader(http.StatusNotFound) + return } mResponse := &MatchResponse{ @@ -360,6 +361,8 @@ func getMatch(w http.ResponseWriter, r *http.Request) { db.Lock.RUnlock() if err != nil { log.Errorf("[GM] can't find stats for match %d: %v", tMatch.ID, err) + w.WriteHeader(http.StatusInternalServerError) + return } for _, iStats := range tStats {