mirror of https://github.com/k3s-io/k3s
Add WrappedRoundTripper() to tokenSourceTransport
parent
a1ccb1a7c3
commit
d8dc9e1f7a
|
@ -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") != "" {
|
||||||
|
|
Loading…
Reference in New Issue