return after writing header
This commit is contained in:
3
main.go
3
main.go
@@ -340,6 +340,7 @@ func getMatch(w http.ResponseWriter, r *http.Request) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warningf("[GM] match %d not found: %+v", matchId, err)
|
log.Warningf("[GM] match %d not found: %+v", matchId, err)
|
||||||
w.WriteHeader(http.StatusNotFound)
|
w.WriteHeader(http.StatusNotFound)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
mResponse := &MatchResponse{
|
mResponse := &MatchResponse{
|
||||||
@@ -360,6 +361,8 @@ func getMatch(w http.ResponseWriter, r *http.Request) {
|
|||||||
db.Lock.RUnlock()
|
db.Lock.RUnlock()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("[GM] can't find stats for match %d: %v", tMatch.ID, err)
|
log.Errorf("[GM] can't find stats for match %d: %v", tMatch.ID, err)
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, iStats := range tStats {
|
for _, iStats := range tStats {
|
||||||
|
Reference in New Issue
Block a user