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

Check both closing and consuming the response body #43

Open
atzoum opened this issue Jan 26, 2023 · 0 comments
Open

Check both closing and consuming the response body #43

atzoum opened this issue Jan 26, 2023 · 0 comments

Comments

@atzoum
Copy link

atzoum commented Jan 26, 2023

In the GoDoc of http.Response this rule is clearly described.

It is the caller's responsibility to close Body. The default HTTP client's Transport may not reuse HTTP/1.x "keep-alive" TCP connections if the Body is not read to completion and closed.

This is what reuseconn fork tries to address by verifying that the response body is consumed as well. It would be great if it was possible to incorporate such linting behaviour in bodyclose.

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

No branches or pull requests

1 participant