Remove Host header attribute from proxied request (#252)

Explicitly set hostame for proxied requests
This commit is contained in:
Sven Müller
2018-04-17 18:14:55 +02:00
committed by Łukasz Mierzwa
parent 05c2888c57
commit fbd325e10c

View File

@@ -35,6 +35,10 @@ func NewAlertmanagerProxy(alertmanager *alertmanager.Alertmanager) (*httputil.Re
// upstream, there's a gzip middleware that's global so we don't want it
// to gzip twice
req.Header.Del("Accept-Encoding")
// set hostname of proxied target
req.Host = upstreamURL.Host
log.Debugf("[%s] Proxy request for %s", alertmanager.Name, req.URL.Path)
},
Transport: alertmanager.HTTPTransport,