Skip to content


Merge pull request #1175 from chienfuchen32/patch-1
Browse files Browse the repository at this point in the history
Add http response close in client post function
  • Loading branch information
nickysemenza committed Feb 24, 2021
2 parents c6f04ed + 152fb8b commit 2215630
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions api/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ func (srv *server) post(url string, jsonData []byte) (*api.Response, error) {
return nil, errors.Wrap(errors.APIClientError, errors.ClientHTTPError, err)
defer req.Body.Close()
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil, errors.Wrap(errors.APIClientError, errors.IOError, err)
Expand Down

0 comments on commit 2215630

Please sign in to comment.