Uso la seguente regola CSP:
Content-Security-Policy: require-sri-for script style
So che se carico lo stile e lo script da un CDN verrà bloccato se non includo il loro hash.
Ma se servo il mio script e lo stile dal mio dominio, rimarrà accessibile? (CORS è disabilitato)
Chiedo questo perché un visitatore del sito me lo invia:
2017-02-18 21:52:14.622 example.com/:1 Refused to load the stylesheet 'https://example.com/assets/css/main.css' because 'require-sri-for' directive requires integrity attribute be present for all stylesheets.
2017-02-18 21:52:14.632 example.com/:1 Refused to load the script 'https://example.com/assets/js/main.min.js' because 'require-sri-for' directive requires integrity attribute be present for all scripts.
2017-02-18 21:52:14.633 example.com/:1 Refused to load the script 'https://example.com/assets/js/katex.min.js' because 'require-sri-for' directive requires integrity attribute be present for all scripts.
2017-02-18 21:52:14.633 example.com/:1 Refused to load the script 'https://example.com/assets/js/section.min.js' because 'require-sri-for' directive requires integrity attribute be present for all scripts.
2017-02-18 21:52:14.633 example.com/:1 Refused to load the script 'https://example.com/assets/js/canvas.js' because 'require-sri-for' directive requires integrity attribute be present for all scripts.
2017-02-18 22:01:13.667 example.com/:1 Refused to load the stylesheet 'https://example.com/assets/css/main.css' because 'require-sri-for' directive requires integrity attribute be present for all stylesheets.
Questo non suona normale e non potrei riprodurlo su nessun dispositivo.
Modifica
Ho scoperto che è possibile aggiungere un hash SRI allo stile e allo script, ma la domanda rimane, è necessario farlo?