mirror of
https://github.com/fosrl/newt.git
synced 2026-02-07 21:46:39 +00:00
Fix host header not working in health checks
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user