Fix host header not working in health checks

Former-commit-id: cdfcf49d89
This commit is contained in:
Owen
2025-12-11 14:20:52 -05:00
parent 073fa30d66
commit 21f34d4acc
+6 -1
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