Skip to content

Commit

Permalink
fix: http body no close in ping method #92 (#104)
Browse files Browse the repository at this point in the history
Signed-off-by: lookupman <[email protected]>
  • Loading branch information
dream-kzx authored Jul 14, 2024
1 parent 5898fcc commit 13b1c27
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions opengemini/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ func (c *client) Ping(idx int) error {
if err != nil {
return errors.New("ping request failed, error: " + err.Error())
}

defer resp.Body.Close()

if resp.StatusCode != http.StatusNoContent {
body, err := io.ReadAll(resp.Body)
if err != nil {
Expand Down

0 comments on commit 13b1c27

Please sign in to comment.