mirror of
https://github.com/fosrl/newt.git
synced 2026-05-13 19:59:53 +00:00
Use follow redirects bool
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user