dhcp4: close healthiness checking connection

This commit is contained in:
Michael Stapelberg 2020-09-14 12:54:14 +02:00
parent fddfe80222
commit f8d79d0ecc

View File

@ -60,6 +60,7 @@ func healthy() error {
if err != nil { if err != nil {
return err return err
} }
defer resp.Body.Close()
if got, want := resp.StatusCode, http.StatusOK; got != want { if got, want := resp.StatusCode, http.StatusOK; got != want {
b, _ := ioutil.ReadAll(resp.Body) b, _ := ioutil.ReadAll(resp.Body)
return fmt.Errorf("%v: got HTTP %v (%s), want HTTP status %v", return fmt.Errorf("%v: got HTTP %v (%s), want HTTP status %v",