NewBasicAuthRoundTripper will apply a BASIC auth authorization header to a request unless it has already been set.
(username, password SecretReader, rt http.RoundTripper)
| 904 | // NewBasicAuthRoundTripper will apply a BASIC auth authorization header to a request unless it has |
| 905 | // already been set. |
| 906 | func NewBasicAuthRoundTripper(username, password SecretReader, rt http.RoundTripper) http.RoundTripper { |
| 907 | return &basicAuthRoundTripper{username, password, rt} |
| 908 | } |
| 909 | |
| 910 | func (rt *basicAuthRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { |
| 911 | if len(req.Header.Get("Authorization")) != 0 || isCrossHostRedirect(req) { |
no outgoing calls
no test coverage detected