Skip to content

Commit

Permalink
v3.5.9
Browse files Browse the repository at this point in the history
  • Loading branch information
novykh committed Aug 14, 2023
1 parent fe67781 commit 33654c4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
1 change: 1 addition & 0 deletions src/sdk/initialAttributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,4 +236,5 @@ export default {
},

bearer: null,
xNetdataBearer: null,
}
10 changes: 8 additions & 2 deletions src/sdk/makeChart/makeDataFetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")}`,
}),
},
}),
}
Expand Down

0 comments on commit 33654c4

Please sign in to comment.