Use follow redirects bool

This commit is contained in:
Owen
2026-04-15 21:36:40 -07:00
parent 9bb8eaeadb
commit e8961c5de5

View File

@@ -202,6 +202,14 @@ func (m *Monitor) addTargetUnsafe(config Config) error {
ctx: ctx,
cancel: cancel,
client: &http.Client{
CheckRedirect: func() func(*http.Request, []*http.Request) error {
if !config.FollowRedirects {
return func(req *http.Request, via []*http.Request) error {
return http.ErrUseLastResponse
}
}
return nil
}(),
Transport: &http.Transport{
TLSClientConfig: &tls.Config{
// Configure TLS settings based on certificate enforcement