Skip to content
This repository has been archived by the owner on Aug 20, 2021. It is now read-only.

HTTP checker does not close response body #8

Open
kemics opened this issue Aug 7, 2018 · 0 comments
Open

HTTP checker does not close response body #8

kemics opened this issue Aug 7, 2018 · 0 comments

Comments

@kemics
Copy link

kemics commented Aug 7, 2018

Hello, I noticed that checks.HTTPChecker sends a request, but it does not close the response body

https://github.com/docker/go-healthcheck/blob/a4f20681d8a1929b947920b5dfe2d16809d815ca/checks/checks.go#L41-L48

It should be closed or it will lead to a file descriptions leak, so I guess that it is a bug

P.S. Client in checks.HTTPChecker
https://github.com/docker/go-healthcheck/blob/a4f20681d8a1929b947920b5dfe2d16809d815ca/checks/checks.go#L29-L31

could be reused, if it was declared before this line https://github.com/docker/go-healthcheck/blob/a4f20681d8a1929b947920b5dfe2d16809d815ca/checks/checks.go#L28

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant