From 33654c4e4bd5595383682d2462e8e24722023647 Mon Sep 17 00:00:00 2001 From: novykh Date: Mon, 14 Aug 2023 22:57:30 +0300 Subject: [PATCH] v3.5.9 --- package.json | 2 +- src/sdk/initialAttributes.js | 1 + src/sdk/makeChart/makeDataFetch.js | 10 ++++++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 698b3278..811bd112 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@netdata/charts", - "version": "3.5.8", + "version": "3.5.9", "description": "Netdata frontend SDK and chart utilities", "main": "index.js", "module": "es6/index.js", diff --git a/src/sdk/initialAttributes.js b/src/sdk/initialAttributes.js index d26aca91..6a1d31d1 100644 --- a/src/sdk/initialAttributes.js +++ b/src/sdk/initialAttributes.js @@ -236,4 +236,5 @@ export default { }, bearer: null, + xNetdataBearer: null, } diff --git a/src/sdk/makeChart/makeDataFetch.js b/src/sdk/makeChart/makeDataFetch.js index 627ff010..d34970f3 100644 --- a/src/sdk/makeChart/makeDataFetch.js +++ b/src/sdk/makeChart/makeDataFetch.js @@ -160,9 +160,15 @@ export default chart => { abortController = new AbortController() const options = { signal: abortController.signal, - ...(chart.getAttribute("bearer") && { + ...((chart.getAttribute("bearer") || chart.getAttribute("xNetdataBearer")) && { headers: { - Authorization: "Bearer " + chart.getAttribute("bearer"), + ...(chart.getAttribute("bearer") + ? { + Authorization: `Bearer ${chart.getAttribute("bearer")}`, + } + : { + "X-Netdata-Auth": `Bearer ${chart.getAttribute("xNetdataBearer")}`, + }), }, }), }