mirror of
https://github.com/coder/coder.git
synced 2025-07-08 11:39:50 +00:00
fix: use DefaultTransport
in exchangeWithClientSecret
if nil (#10551)
This commit is contained in:
@ -635,6 +635,9 @@ func (e *exchangeWithClientSecret) Exchange(ctx context.Context, code string, op
|
||||
httpClient = http.DefaultClient
|
||||
}
|
||||
oldTransport := httpClient.Transport
|
||||
if oldTransport == nil {
|
||||
oldTransport = http.DefaultTransport
|
||||
}
|
||||
httpClient.Transport = roundTripper(func(req *http.Request) (*http.Response, error) {
|
||||
req.Header.Set("Authorization", "Bearer "+e.ClientSecret)
|
||||
return oldTransport.RoundTrip(req)
|
||||
|
Reference in New Issue
Block a user