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
Instead of always defaulting to http.DefaultClient, allowing passing one during NewClient configuration
Use cases
This would allow one to specify a custom roundtripper without mutating the http.DefaultClient global variable, this could be useful for adding certificates for custom endpoints that use self-signed certificates or are missing intermediaries.
Proposed solution
Simply allow passing an http client in the New* constructors
Is there a workaround to accomplish this today?
Mutate the global http.DefaultClient which is bad practice and has unintended side-effects for shared code
References & Prior Work
Nope
The text was updated successfully, but these errors were encountered:
Summary
Instead of always defaulting to
http.DefaultClient
, allowing passing one during NewClient configurationUse cases
This would allow one to specify a custom roundtripper without mutating the
http.DefaultClient
global variable, this could be useful for adding certificates for custom endpoints that use self-signed certificates or are missing intermediaries.Proposed solution
Simply allow passing an http client in the
New*
constructorsIs there a workaround to accomplish this today?
Mutate the global
http.DefaultClient
which is bad practice and has unintended side-effects for shared codeReferences & Prior Work
Nope
The text was updated successfully, but these errors were encountered: