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

View File

@ -80,7 +80,7 @@ func NewApiPluginProxy(ctx *m.ReqContext, proxyPath string, route *plugins.AppPl
req.Header.Add("X-Grafana-Context", string(ctxJson))
if cfg.SendUserHeader {
if cfg.SendUserHeader && !ctx.SignedInUser.IsAnonymous {
req.Header.Add("X-Grafana-User", ctx.SignedInUser.Login)
}