[v10.3.x] Remove X-Grafana-Device-Id from outbound requests (#81959)

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

(cherry picked from commit cf616d5074)

Co-authored-by: Jo <joao.guerreiro@grafana.com>
This commit is contained in:
grafana-delivery-bot[bot]
2024-02-06 14:35:14 +01:00
committed by GitHub
co-authored by Jo
parent a29045adeb
commit f72a60f9ab
@@ -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)