(req *http.Request, c creds.Creds)
| 317 | } |
| 318 | |
| 319 | func setRequestAuthWithCreds(req *http.Request, c creds.Creds) { |
| 320 | authtype := creds.FirstEntryForKey(c, "authtype") |
| 321 | credential := creds.FirstEntryForKey(c, "credential") |
| 322 | if len(authtype) == 0 && len(credential) == 0 { |
| 323 | user := creds.FirstEntryForKey(c, "username") |
| 324 | pass := creds.FirstEntryForKey(c, "password") |
| 325 | setRequestAuth(req, user, pass) |
| 326 | return |
| 327 | } |
| 328 | |
| 329 | auth := fmt.Sprintf("%s %s", authtype, credential) |
| 330 | req.Header.Set("Authorization", auth) |
| 331 | } |
| 332 | |
| 333 | func getReqOperation(req *http.Request) string { |
| 334 | operation := "download" |
no test coverage detected