Skip to content

Commit 6295db0

Browse files
committed
discard healthcheck body and close it
1 parent 7adabb4 commit 6295db0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: health/health.go

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package health
1919
import (
2020
"encoding/json"
2121
"fmt"
22+
"io"
2223
"log"
2324
"net/http"
2425
"sync"
@@ -198,6 +199,8 @@ func (hc *httpChecker) Check() error {
198199
if err != nil {
199200
return err
200201
}
202+
io.Copy(io.Discard, resp.Body)
203+
defer resp.Body.Close()
201204
if resp.StatusCode >= 200 && resp.StatusCode < 400 {
202205
return nil
203206
}

0 commit comments

Comments
 (0)