checkRedirect is a method that checks if the number of redirects exceeds the maximum allowed
(req *http.Request, via []*http.Request)
| 73 | |
| 74 | // checkRedirect is a method that checks if the number of redirects exceeds the maximum allowed |
| 75 | func (f *Fetcher) checkRedirect(req *http.Request, via []*http.Request) error { |
| 76 | redirects := len(via) |
| 77 | if redirects >= f.config.MaxRedirects { |
| 78 | return newTooManyRedirectsError(redirects) |
| 79 | } |
| 80 | return nil |
| 81 | } |
| 82 | |
| 83 | // newHttpClient returns new HTTP client |
| 84 | func (f *Fetcher) newHttpClient() *http.Client { |
nothing calls this directly
no test coverage detected