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

Avoid resource leak in timestamp_infos #120

Merged
merged 1 commit into from
Apr 15, 2024
Merged

Conversation

ddelemeny
Copy link
Collaborator

Response.Body should be closed in any case

If the returned error is nil, the Response will contain a non-nil Body which the user is expected to close. If the Body is not both read to EOF and closed, the Client's underlying RoundTripper (typically Transport) may not be able to re-use a persistent TCP connection to the server for a subsequent "keep-alive" request.

https://pkg.go.dev/net/http#Client.Do

@ddelemeny ddelemeny merged commit fe3e009 into main Apr 15, 2024
2 checks passed
@ddelemeny ddelemeny deleted the ddelemeny/fix-body-close branch April 18, 2024 15:40
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.

1 participant