injectCSS method not attaching csp nonce passed to it. it is used in antd components internally
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 65/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, typescript
- Ambito
- frontend
Direzione di ricerca
Inizia leggendo node_modules/rc-util/es/Dom/dynamicCSS.js e node_modules/rc-util/lib/Dom/dynamicCSS.js, concentrandoti su injectCSS e sulla relativa gestione di CSP. Verifica che l’implementazione conservi il nonce passato a injectCSS sull’elemento style generato, quindi aggiungi o aggiorna un test pertinente se il repository ne fornisce uno.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch rc-util@5.44.4 for the project I'm working on.
Here is the diff that solved my problem:
diff --git a/node_modules/rc-util/es/Dom/dynamicCSS.js b/node_modules/rc-util/es/Dom/dynamicCSS.js
index 8ddec00..9e5efee 100644
--- a/node_modules/rc-util/es/Dom/dynamicCSS.js
+++ b/node_modules/rc-util/es/Dom/dynamicCSS.js
@@ -52,7 +52,8 @@ export function injectCSS(css) {
styleNode.setAttribute(APPEND_PRIORITY, "".concat(priority));
}
if (csp !== null && csp !== void 0 && csp.nonce) {
- styleNode.nonce = csp === null || csp === void 0 ? void 0 : csp.nonce;
+ styleNode.setAttribute('nonce', csp.nonce);
+ // styleNode.nonce = csp === null || csp === void 0 ? void 0 : csp.nonce;
}
styleNode.innerHTML = css;
var container = getContainer(option);
diff --git a/node_modules/rc-util/lib/Dom/dynamicCSS.js b/node_modules/rc-util/lib/Dom/dynamicCSS.js
index 95a5191..be33605 100644
--- a/node_modules/rc-util/lib/Dom/dynamicCSS.js
+++ b/node_modules/rc-util/lib/Dom/dynamicCSS.js
@@ -62,7 +62,8 @@ function injectCSS(css) {
styleNode.setAttribute(APPEND_PRIORITY, "".concat(priority));
}
if (csp !== null && csp !== void 0 && csp.nonce) {
- styleNode.nonce = csp === null || csp === void 0 ? void 0 : csp.nonce;
+ styleNode.setAttribute('nonce', csp.nonce);
+ // styleNode.nonce = csp === null || csp === void 0 ? void 0 : csp.nonce;
}
styleNode.innerHTML = css;
var container = getContainer(option);
This issue body was partially generated by patch-package.
- Lingua principale
- TypeScript
- Stelle
- 670
- Fork
- 205
- Merge medio
- 15g 17h
- PR unite (30g)
- 6
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di react-component/util
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
react-component/util#816 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
react-component/util#738 · 1 commento · 1 reazione ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
react-component/util#710 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
react-component/util#647 · 5 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
react-component/util#644 · 1 commento ·
Tutte le issue di react-component/util
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
[Bug]: Matrix progress drafts fail with "Matrix runtime not initialized" during tool activity Apertabug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
calcite-components needs triage refactor
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Esri/calcite-design-system#15203 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
danielmiessler/LifeOS#2218 ·