mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-21 23:43:27 +01:00
Close #126: Don't follow redirects
This commit is contained in:
parent
38de0ec9cd
commit
a1afeea56b
@ -39,6 +39,9 @@ func GetHTTPClient(insecure bool) *http.Client {
|
|||||||
InsecureSkipVerify: true,
|
InsecureSkipVerify: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
CheckRedirect: func(req *http.Request, via []*http.Request) error {
|
||||||
|
return http.ErrUseLastResponse // Don't follow redirects
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return insecureHTTPClient
|
return insecureHTTPClient
|
||||||
@ -51,6 +54,9 @@ func GetHTTPClient(insecure bool) *http.Client {
|
|||||||
MaxIdleConnsPerHost: 20,
|
MaxIdleConnsPerHost: 20,
|
||||||
Proxy: http.ProxyFromEnvironment,
|
Proxy: http.ProxyFromEnvironment,
|
||||||
},
|
},
|
||||||
|
CheckRedirect: func(req *http.Request, via []*http.Request) error {
|
||||||
|
return http.ErrUseLastResponse // Don't follow redirects
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return secureHTTPClient
|
return secureHTTPClient
|
||||||
|
Loading…
Reference in New Issue
Block a user