From 95581b3653b07f51311eab3872ecc6e2eee34ab2 Mon Sep 17 00:00:00 2001 From: Mike Centola Date: Mon, 1 Aug 2022 23:32:49 -0400 Subject: [PATCH] Add meta name="csp-nonce" option to getNonce function Add in the ability to detect `` to the getNonce function. --- packages/jss/src/DomRenderer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/jss/src/DomRenderer.js b/packages/jss/src/DomRenderer.js index 5151ca7f3..8f55bf869 100644 --- a/packages/jss/src/DomRenderer.js +++ b/packages/jss/src/DomRenderer.js @@ -217,7 +217,7 @@ function insertStyle(style, options) { * Read jss nonce setting from the page if the user has set it. */ const getNonce = memoize(() => { - const node = document.querySelector('meta[property="csp-nonce"]') + const node = document.querySelector('meta[property="csp-nonce"], meta[name="csp-nonce"]') return node ? node.getAttribute('content') : null })