Explorar el Código

Re-enables CSP for production

main
Eric Amodio hace 2 años
padre
commit
1dc14411c6
Se han modificado 1 ficheros con 6 adiciones y 3 borrados
  1. +6
    -3
      webpack.config.js

+ 6
- 3
webpack.config.js Ver fichero

@ -443,7 +443,10 @@ function getCspHtmlPlugin(mode, env) {
mode !== 'production'
? ['#{cspSource}', "'nonce-#{cspNonce}'", "'unsafe-eval'"]
: ['#{cspSource}', "'nonce-#{cspNonce}'"],
'style-src': ['#{cspSource}', "'unsafe-hashes'", "'unsafe-inline'"],
'style-src':
mode === 'production'
? ['#{cspSource}', "'nonce-#{cspNonce}'", "'unsafe-hashes'"]
: ['#{cspSource}', "'unsafe-hashes'", "'unsafe-inline'"],
'font-src': ['#{cspSource}'],
},
{
@ -451,11 +454,11 @@ function getCspHtmlPlugin(mode, env) {
hashingMethod: 'sha256',
hashEnabled: {
'script-src': true,
'style-src': false,
'style-src': mode === 'production',
},
nonceEnabled: {
'script-src': true,
'style-src': false,
'style-src': mode === 'production',
},
},
);

Cargando…
Cancelar
Guardar