Skip to content

Commit 21a220e

Browse files
authored
fix: add nonce grid option set the nonce value for CSP header (#904)
- backported from PR #902
1 parent abebf8a commit 21a220e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

slick.grid.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ if (typeof Slick === "undefined") {
6262
enableAsyncPostRenderCleanup: false,
6363
asyncPostRenderCleanupDelay: 40,
6464
autoHeight: false,
65+
nonce: '',
6566
editorLock: Slick.GlobalEditorLock,
6667
showColumnHeader: true,
6768
showHeaderRow: false,
@@ -2056,7 +2057,7 @@ if (typeof Slick === "undefined") {
20562057

20572058
function createCssRules() {
20582059
_style = document.createElement('style');
2059-
_style.nonce = 'random-string';
2060+
_style.nonce = options.nonce || '';
20602061
(options.shadowRoot || document.head).appendChild(_style);
20612062

20622063
const rowHeight = (options.rowHeight - cellHeightDiff);

0 commit comments

Comments
 (0)