MCPcopy Index your code
hub / github.com/coder/coder / InstrumentHTTPClient

Method InstrumentHTTPClient

coderd/promoauth/oauth2.go:227–235  ·  view source on GitHub ↗

InstrumentHTTPClient will always return a new http client. The new client will match the one passed in, but will have an instrumented round tripper.

(hc *http.Client, source Oauth2Source)

Source from the content-addressed store, hash-verified

225// InstrumentHTTPClient will always return a new http client. The new client will
226// match the one passed in, but will have an instrumented round tripper.
227func (c *Config) InstrumentHTTPClient(hc *http.Client, source Oauth2Source) *http.Client {
228 return &http.Client{
229 // The new tripper will instrument every request made by the oauth2 client.
230 Transport: newInstrumentedTripper(c, source, hc.Transport),
231 CheckRedirect: hc.CheckRedirect,
232 Jar: hc.Jar,
233 Timeout: hc.Timeout,
234 }
235}
236
237// wrapClient is the only way we can accurately instrument the oauth2 client.
238// This is because method calls to the 'OAuth2Config' interface are not 1:1 with

Callers 2

oauthHTTPClientMethod · 0.95
configureGithubOAuth2Function · 0.80

Calls 1

newInstrumentedTripperFunction · 0.85

Tested by

no test coverage detected