Add WrappedRoundTripper() to tokenSourceTransport

k3s-v1.13.4
Darren Shepherd 2019-02-27 23:49:02 -07:00
parent 3a0f127bf5
commit 6294e7032f
1 changed files with 4 additions and 0 deletions

View File

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