mirror of
https://github.com/fosrl/newt.git
synced 2026-02-27 15:26:42 +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
|
// Add headers
|
||||||
for key, value := range target.Config.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
|
// Perform request
|
||||||
|
|||||||
Reference in New Issue
Block a user