diff options
Diffstat (limited to 'modules/caddyhttp/reverseproxy/healthchecks.go')
-rw-r--r-- | modules/caddyhttp/reverseproxy/healthchecks.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/modules/caddyhttp/reverseproxy/healthchecks.go b/modules/caddyhttp/reverseproxy/healthchecks.go index 179805f20..319cc9248 100644 --- a/modules/caddyhttp/reverseproxy/healthchecks.go +++ b/modules/caddyhttp/reverseproxy/healthchecks.go @@ -23,6 +23,7 @@ import ( "net/url" "regexp" "runtime/debug" + "slices" "strconv" "strings" "time" @@ -397,12 +398,8 @@ func (h *Handler) doActiveHealthCheck(dialInfo DialInfo, hostAddr string, networ u.Scheme = "https" // if the port is in the except list, flip back to HTTP - if ht, ok := h.Transport.(*HTTPTransport); ok { - for _, exceptPort := range ht.TLS.ExceptPorts { - if exceptPort == port { - u.Scheme = "http" - } - } + if ht, ok := h.Transport.(*HTTPTransport); ok && slices.Contains(ht.TLS.ExceptPorts, port) { + u.Scheme = "http" } } |