Add WrappedRoundTripper() to tokenSourceTransport

k3s-v1.14.0
Darren Shepherd 2019-02-27 23:49:02 -07:00
parent a1ccb1a7c3
commit d8dc9e1f7a
1 changed files with 4 additions and 0 deletions

View File

@ -64,6 +64,10 @@ type tokenSourceTransport struct {
ort http.RoundTripper ort http.RoundTripper
} }
func (tst *tokenSourceTransport) WrappedRoundTripper() http.RoundTripper {
return tst.base
}
func (tst *tokenSourceTransport) RoundTrip(req *http.Request) (*http.Response, error) { func (tst *tokenSourceTransport) RoundTrip(req *http.Request) (*http.Response, error) {
// This is to allow --token to override other bearer token providers. // This is to allow --token to override other bearer token providers.
if req.Header.Get("Authorization") != "" { if req.Header.Get("Authorization") != "" {