Close Don't follow redirects
@@ -39,6 +39,9 @@ func GetHTTPClient(insecure bool) *http.Client {
InsecureSkipVerify: true,
},
},
+ CheckRedirect: func(req *http.Request, via []*http.Request) error {
+ return http.ErrUseLastResponse // Don't follow redirects
+ },
}
}
return insecureHTTPClient
@@ -51,6 +54,9 @@ func GetHTTPClient(insecure bool) *http.Client {
MaxIdleConnsPerHost: 20,
Proxy: http.ProxyFromEnvironment,
},
+ CheckRedirect: func(req *http.Request, via []*http.Request) error {
+ return http.ErrUseLastResponse // Don't follow redirects
+ },
}
}
return secureHTTPClient
