proxy/grpcproxy: add return on error for metrics handler

Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
release-3.5
Sam Batschelet 2020-03-13 17:53:41 -04:00 committed by Sam Batschelet
parent 23c2380105
commit 7444d3ad53
1 changed files with 1 additions and 0 deletions

View File

@ -89,6 +89,7 @@ func HandleMetrics(mux *http.ServeMux, c *http.Client, eps []string) {
resp, err := c.Get(target)
if err != nil {
http.Error(w, "Internal server error", http.StatusInternalServerError)
return
}
defer resp.Body.Close()
w.Header().Set("Content-Type", "text/plain; version=0.0.4")