oauthHTTPClient returns an http client that will instrument every request made.
(ctx context.Context, source Oauth2Source)
| 247 | |
| 248 | // oauthHTTPClient returns an http client that will instrument every request made. |
| 249 | func (c *Config) oauthHTTPClient(ctx context.Context, source Oauth2Source) *http.Client { |
| 250 | cli := &http.Client{} |
| 251 | |
| 252 | // Check if the context has a http client already. |
| 253 | if hc, ok := ctx.Value(oauth2.HTTPClient).(*http.Client); ok { |
| 254 | cli = hc |
| 255 | } |
| 256 | |
| 257 | cli = c.InstrumentHTTPClient(cli, source) |
| 258 | return cli |
| 259 | } |
| 260 | |
| 261 | type instrumentedTripper struct { |
| 262 | c *Config |
no test coverage detected