Add check so that header is not sent for anonymous users
This commit is contained in:
1 parent
6587a967eb
commit
697a87b7b2
7 files changed
+32
-5
No files matched your search
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user