MCPcopy Index your code
hub / github.com/imroc/req / createDigestAuth

Function createDigestAuth

digest.go:173–190  ·  view source on GitHub ↗
(req *http.Request, resp *http.Response, username, password string)

Source from the content-addressed store, hash-verified

171}
172
173func 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
193func cloner(req *http.Request) (func() (*http.Request, error), error) {

Callers 1

handleDigestAuthFuncFunction · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…