You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As explained in consulapi#1499 and go-dockerclient#434, it is not safe at all to replace http.DefaultClient with &http.Client{} or cleanhttp.DefaultClient(), and the README should address this fairly obscure and dangerous issue. I think it should suggest library authors to either instantiate a global DefaultClient, or to set DisableKeepAlives to true.
The text was updated successfully, but these errors were encountered:
Using a global default client negates the point of this library, which is to ensure that you are using a clean client that will not be modified willy-nilly by other parts of an application. What you're suggesting is simply a different use-case than this library is designed for.
cleanhttp.DefaultClient() can not replace http.DefaultClient due to unbound growth of the number of established connections of many cleanhttp.DefaultClient()s in the connection pools of their http transports, and per-library global default client as in hashicorp/consul#1517 currently is the best use of this library.
As explained in consulapi#1499 and go-dockerclient#434, it is not safe at all to replace
http.DefaultClient
with&http.Client{}
orcleanhttp.DefaultClient()
, and the README should address this fairly obscure and dangerous issue. I think it should suggest library authors to either instantiate a globalDefaultClient
, or to setDisableKeepAlives
totrue
.The text was updated successfully, but these errors were encountered: