(req *http.Request, resp *http.Response, username, password string)
| 171 | } |
| 172 | |
| 173 | func createDigestAuth(req *http.Request, resp *http.Response, username, password string) (auth string, err error) { |
| 174 | chal, err := digest.FindChallenge(resp.Header) |
| 175 | if err != nil { |
| 176 | return "", err |
| 177 | } |
| 178 | cred, err := digest.Digest(chal, digest.Options{ |
| 179 | Username: username, |
| 180 | Password: password, |
| 181 | Method: req.Method, |
| 182 | URI: req.URL.RequestURI(), |
| 183 | GetBody: req.GetBody, |
| 184 | Count: 1, |
| 185 | }) |
| 186 | if err != nil { |
| 187 | return "", err |
| 188 | } |
| 189 | return cred.String(), nil |
| 190 | } |
| 191 | |
| 192 | // cloner returns a function which makes clones of the provided request |
| 193 | func cloner(req *http.Request) (func() (*http.Request, error), error) { |
no test coverage detected
searching dependent graphs…