postcss-url causes CSP valolation when url is set to 'inline'
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 38/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- javascript
- Ambito
- build-system
Direzione di ricerca
Start with the provided PostCSS configuration, especially the postcss-url setting url: "inline", and compare development output with the built main.195fbc3377ced840.js under the reported Content Security Policy. Reproduce the browser violation and determine what behavior is expected when assets are embedded; done means the built output no longer triggers the reported CSP error.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I want to embed my font and image files into my js file using postcss-url.
Here is my postcss config:
module.exports = {
plugins: {
tailwindcss: {
config: join(__dirname, 'tailwind.config.js'),
},
autoprefixer: {},
cssnano: {},
'postcss-import': {},
'postcss-url': {
url: "inline",
maxSize: 128 * 1024,
useHash: true,
}
},
};
Everything works fine in development mode. But when I moved built files to the server, I faced this error in browser:
main.195fbc3377ced840.js:2 Refused to apply inline style because it violates the following Content Security Policy directive: "default-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'style-src' was not explicitly set, so 'default-src' is used as a fallback.
- Lingua principale
- JavaScript
- Stelle
- 383
- Fork
- 58
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
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 postcss/postcss-url
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 38/100
postcss/postcss-url#183 · 1 commento · 1 reazione ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 55/100
postcss/postcss-url#181 · 1 reazione ·
-
postcss-import integration Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
postcss/postcss-url#180 · 1 reazione ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
postcss/postcss-url#179 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
postcss/postcss-url#177 · 1 commento ·
Tutte le issue di postcss/postcss-url
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Daemon passes --experimental-wasm-jspi unconditionally on Node >= 24; Node 26 rejects the flag Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Automattic/studio#4908 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
sugarlabs/musicblocks#8847 ·