我有以下CSP标头:
script-src'self'* .google.com * .googletagmanager.com * .google-analytics.com'nonce-XXXXXX'; style-src'self''unsafe-inline'* .googleapis.com * .gstatic.com; img-src'self'* .google-analytics.com; font-src https://fonts.gstatic.com/; object-src'none'; connect-src'self'wss :;框架祖先“无”; report-uri XXXX;
该站点当前在
下运行脚本:
<script async defer src="https://www.google.com/recaptcha/api.js?render=explicit"
nonce="XXXXXX"></script>
在加载包含验证码的页面或提交表单后,我得到了一堆报告,其中包含以下错误:
blocked-uri eval
column-number 8
document-uri https://127.0.0.1/test/
line-number 27
original-policy script-src 'nonce-06119715-2ed2-42ae-99b1-edf58ab76283' 'nonce-8834c239-fa22-4e70-965d-8134dc20ae4e'; style-src 'self'; img-src 'self'; font-src https://fonts.gstatic.com/; object-src 'none'; report-uri https://127.0.0.1/test/csp-report
referrer
source-file blob:https://127.0.0.1/47fba858-3af0-4468-a1fe-32e077414fc1
violated-directive script-src
如果我允许“不安全内联”,则报告会消失。我究竟做错了什么?
我正在按照reCAPTCHA with Content Security Policy页上的说明进行操作,但没有成功。