Remove X-Grafana-Device-Id from outbound requests (#81957)

This commit is contained in:
Jo 2024-02-06 14:06:19 +01:00 committed by GitHub
parent 7292b84614
commit cf616d5074
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -209,6 +209,9 @@ func WithAuthHTTPHeaders(ctx context.Context, cfg *setting.Cfg) context.Context
// used by basic auth, api keys and potentially jwt auth
list.Items = append(list.Items, "Authorization")
// remove X-Grafana-Device-Id as it is only used for auth in authn clients.
list.Items = append(list.Items, "X-Grafana-Device-Id")
// if jwt is enabled we add it to the list. We can ignore in case it is set to Authorization
if cfg.JWTAuthEnabled && cfg.JWTAuthHeaderName != "" && cfg.JWTAuthHeaderName != "Authorization" {
list.Items = append(list.Items, cfg.JWTAuthHeaderName)