@grafana/data: Update xss dependency (#43423)
This commit is contained in:
@@ -39,7 +39,7 @@
|
||||
"rxjs": "7.3.0",
|
||||
"tslib": "2.3.1",
|
||||
"uplot": "1.6.16",
|
||||
"xss": "1.0.6"
|
||||
"xss": "1.0.10"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@grafana/tsconfig": "^1.0.0-rc1",
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import xss from 'xss';
|
||||
import { FilterXSS, whiteList, IWhiteList } from 'xss';
|
||||
import { sanitizeUrl as braintreeSanitizeUrl } from '@braintree/sanitize-url';
|
||||
|
||||
const XSSWL = Object.keys(xss.whiteList).reduce((acc, element) => {
|
||||
// @ts-ignore
|
||||
acc[element] = xss.whiteList[element].concat(['class', 'style']);
|
||||
const XSSWL = Object.keys(whiteList).reduce((acc, element) => {
|
||||
acc[element] = whiteList[element]?.concat(['class', 'style']);
|
||||
return acc;
|
||||
}, {});
|
||||
}, {} as IWhiteList);
|
||||
|
||||
const sanitizeXSS = new xss.FilterXSS({
|
||||
const sanitizeXSS = new FilterXSS({
|
||||
whiteList: XSSWL,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user