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)
| 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. |
| 227 | func (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 |
no test coverage detected