Add check so that header is not sent for anonymous users

This commit is contained in:
Andrej Ocenas
2019-03-14 16:28:32 +01:00
parent 6587a967eb
commit 697a87b7b2
7 changed files with 32 additions and 5 deletions
+1 -1
View File
@@ -172,7 +172,7 @@ func (proxy *DataSourceProxy) getDirector() func(req *http.Request) {
req.Header.Add("Authorization", dsAuth)
}
if proxy.cfg.SendUserHeader {
if proxy.cfg.SendUserHeader && !proxy.ctx.SignedInUser.IsAnonymous {
req.Header.Add("X-Grafana-User", proxy.ctx.SignedInUser.Login)
}