MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / checkRedirect

Method checkRedirect

fetcher/fetcher.go:75–81  ·  view source on GitHub ↗

checkRedirect is a method that checks if the number of redirects exceeds the maximum allowed

(req *http.Request, via []*http.Request)

Source from the content-addressed store, hash-verified

73
74// checkRedirect is a method that checks if the number of redirects exceeds the maximum allowed
75func (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
84func (f *Fetcher) newHttpClient() *http.Client {

Callers

nothing calls this directly

Calls 1

newTooManyRedirectsErrorFunction · 0.85

Tested by

no test coverage detected