jfrog / jfrog-client-go

All go clients for JFrog products
Apache License 2.0
260 stars 139 forks source link

Fix to close response body before status check #965

Closed nakabonne closed 2 months ago

nakabonne commented 2 months ago

httpclient.HttpClient.UploadFileFromReader() used to not to close the HTTP response body when the status code is unexpected. The defer block for this should be appended right after the HTTP call is made.

github-actions[bot] commented 2 months ago

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

nakabonne commented 2 months ago

I have read the CLA Document and I hereby sign the CLA

sverdlov93 commented 2 months ago

Hi @nakabonne, Thanks for your contribution!

nakabonne commented 2 months ago

@sverdlov93 Thank you for your quick review! We're stuck with the goroutine leak issue because of this. Can you estimate approximately when this will be released?

sverdlov93 commented 2 months ago

Hi @nakabonne,

Do you need this as part of the JFrog CLI, or do you use jfrog-client-go as a dependency?

nakabonne commented 2 months ago

@sverdlov93 We use jfrog-client-go as a dependency in our Go project.

sverdlov93 commented 2 months ago

@nakabonne Its released! Thanks again for your contribution!

nakabonne commented 2 months ago

Thank you for the quick release and for maintaining this project!