Skip to content

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
@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

1 participant