Skip to content

Commit

Permalink
Fix misleading Authorization: <redacted> (#864)
Browse files Browse the repository at this point in the history
This is currently always set, but we should only set it if there are
actually credentials being redacted, so that we can tell if the header
was set or not.
  • Loading branch information
jonjohnsonjr committed Dec 8, 2020
1 parent bac0862 commit 6cb5945
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/v1/remote/transport/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (t *logTransport) RoundTrip(in *http.Request) (out *http.Response, err erro

// Save these headers so we can redact Authorization.
savedHeaders := in.Header.Clone()
if in.Header != nil {
if in.Header != nil && in.Header.Get("authorization") != "" {
in.Header.Set("authorization", "<redacted>")
}

Expand Down

0 comments on commit 6cb5945

Please sign in to comment.