mirror of
https://github.com/prymitive/karma
synced 2026-05-05 03:16:51 +00:00
Remove Host header attribute from proxied request (#252)
Explicitly set hostame for proxied requests
This commit is contained in:
committed by
Łukasz Mierzwa
parent
05c2888c57
commit
fbd325e10c
4
proxy.go
4
proxy.go
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user