Fix host header not working in health checks

This commit is contained in:
Owen
2025-12-11 14:20:52 -05:00
parent 2fb4bf09ea
commit cdfcf49d89

View File

@@ -398,7 +398,12 @@ func (m *Monitor) performHealthCheck(target *Target) {
// Add headers
for key, value := range target.Config.Headers {
req.Header.Set(key, value)
// Handle Host header specially - it must be set on req.Host, not in headers
if strings.EqualFold(key, "Host") {
req.Host = value
} else {
req.Header.Set(key, value)
}
}
// Perform request