fix(inputs.prometheus): Correctly handle host header (#15195)
This commit is contained in:
parent
f5d393ca14
commit
6bb3d32da9
|
|
@ -437,7 +437,11 @@ func (p *Prometheus) gatherURL(u URLAndAddress, acc telegraf.Accumulator) (map[s
|
|||
}
|
||||
|
||||
for key, value := range p.HTTPHeaders {
|
||||
req.Header.Set(key, value)
|
||||
if strings.EqualFold(key, "host") {
|
||||
req.Host = value
|
||||
} else {
|
||||
req.Header.Set(key, value)
|
||||
}
|
||||
}
|
||||
|
||||
var err error
|
||||
|
|
|
|||
Loading…
Reference in New Issue