mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 04:12:09 +08:00
Added basic auth to data source edit/create, add support for basic auth in data source proxy code, Closes #1510
This commit is contained in:
@ -35,6 +35,10 @@ func NewReverseProxy(ds *m.DataSource, proxyPath string) *httputil.ReverseProxy
|
||||
} else {
|
||||
req.URL.Path = util.JoinUrlFragments(target.Path, proxyPath)
|
||||
}
|
||||
|
||||
if ds.BasicAuth {
|
||||
req.Header.Add("Authorization", util.GetBasicAuthHeader(ds.BasicAuthUser, ds.BasicAuthPassword))
|
||||
}
|
||||
}
|
||||
|
||||
return &httputil.ReverseProxy{Director: director}
|
||||
|
Reference in New Issue
Block a user