Skip to content
This repository has been archived by the owner on Sep 15, 2022. It is now read-only.

Commit

Permalink
Close response body.
Browse files Browse the repository at this point in the history
  • Loading branch information
ksputo committed Jan 7, 2020
1 parent e941b81 commit ced07b1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/health/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ func handleHealth(etcdURL string) func(w http.ResponseWriter, req *http.Request)
w.WriteHeader(http.StatusInternalServerError)
return
}
defer resp.Body.Close()
if resp.StatusCode != 200 {
w.WriteHeader(http.StatusInternalServerError)
return
Expand All @@ -21,6 +22,7 @@ func handleHealth(etcdURL string) func(w http.ResponseWriter, req *http.Request)

w.WriteHeader(http.StatusOK)
fmt.Fprint(w, "OK")

return
}
}

0 comments on commit ced07b1

Please sign in to comment.