Skip to content

Commit

Permalink
Ensure response body is always closed in CloudControllerConnection (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
chitoku-k authored Jan 18, 2024
1 parent 0532b23 commit e0bd5de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/cloudcontroller/cloud_controller_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func (connection *CloudControllerConnection) Make(request *Request, passedRespon
if err != nil {
return connection.processRequestErrors(request.Request, err)
}
defer response.Body.Close()

return connection.populateResponse(response, passedResponse)
}
Expand All @@ -64,7 +65,6 @@ func (*CloudControllerConnection) handleStatusCodes(response *http.Response, pas
passedResponse.RawResponse = []byte("{}")
} else {
rawBytes, err := ioutil.ReadAll(response.Body)
defer response.Body.Close()
if err != nil {
return err
}
Expand Down

0 comments on commit e0bd5de

Please sign in to comment.