mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 16:45:43 -06:00
fix(influxdb): clear existing Authorization header when proxying request to InfluxDB, fixes #2778
This commit is contained in:
parent
f4f7f47901
commit
a23217cc6f
@ -43,6 +43,7 @@ func NewReverseProxy(ds *m.DataSource, proxyPath string, targetUrl *url.URL) *ht
|
||||
reqQueryVals.Add("db", ds.Database)
|
||||
req.URL.RawQuery = reqQueryVals.Encode()
|
||||
if !ds.BasicAuth {
|
||||
req.Header.Del("Authorization")
|
||||
req.Header.Add("Authorization", util.GetBasicAuthHeader(ds.User, ds.Password))
|
||||
}
|
||||
} else {
|
||||
@ -50,6 +51,7 @@ func NewReverseProxy(ds *m.DataSource, proxyPath string, targetUrl *url.URL) *ht
|
||||
}
|
||||
|
||||
if ds.BasicAuth {
|
||||
req.Header.Del("Authorization")
|
||||
req.Header.Add("Authorization", util.GetBasicAuthHeader(ds.BasicAuthUser, ds.BasicAuthPassword))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user