Commit 52e8d6b9 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #45529 from wanghaoran1988/fix_issue_44476

Automatic merge from submit-queue oidc auth plugin not to override the Auth header if it's already exits **What this PR does / why we need it**: oidc auth client plugin should not override the `Authorization` header if it's already exits. **Which issue this PR fixes** : fix oidc auth plugin override the` Authorization` header **Special notes for your reviewer**: **Release note**:
parents 6f5337cf f54a0809
...@@ -216,6 +216,9 @@ type roundTripper struct { ...@@ -216,6 +216,9 @@ type roundTripper struct {
} }
func (r *roundTripper) RoundTrip(req *http.Request) (*http.Response, error) { func (r *roundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
if len(req.Header.Get("Authorization")) != 0 {
return r.wrapped.RoundTrip(req)
}
token, err := r.provider.idToken() token, err := r.provider.idToken()
if err != nil { if err != nil {
return nil, err return nil, err
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment