Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api: res.Body should be closed properly #561

Merged
merged 2 commits into from
Dec 9, 2016
Merged

Conversation

kanekv
Copy link

@kanekv kanekv commented Dec 8, 2016

@@ -495,6 +495,8 @@ func (c Client) executeMethod(method string, metadata requestMetadata) (res *htt

// Read the body to be saved later.
errBodyBytes, err := ioutil.ReadAll(res.Body)
// res.Body should be closed
res.Body.Close()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use "closeResponse()" itself. there is a need to do that in Go http client.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess won't hurt, changing

@harshavardhana harshavardhana changed the title close res.Body api: res.Body should be closed properly Dec 9, 2016
@harshavardhana harshavardhana merged commit e06b3b7 into minio:master Dec 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants