downloadClient validates rawURL for its mode and returns the client for it.
(rawURL string, loopback bool)
| 562 | |
| 563 | // downloadClient validates rawURL for its mode and returns the client for it. |
| 564 | func downloadClient(rawURL string, loopback bool) (*http.Client, error) { |
| 565 | if loopback { |
| 566 | if err := validateLoopbackURL(rawURL); err != nil { |
| 567 | return nil, err |
| 568 | } |
| 569 | return loopbackClient, nil |
| 570 | } |
| 571 | if err := validateURLScheme(rawURL); err != nil { |
| 572 | return nil, err |
| 573 | } |
| 574 | return httpsOnlyClient, nil |
| 575 | } |
| 576 | |
| 577 | func httpGet(rawURL, dest string, loopback bool) error { |
| 578 | client, err := downloadClient(rawURL, loopback) |
no test coverage detected