lowcode-engine icon indicating copy to clipboard operation
lowcode-engine copied to clipboard

引擎能力被 CSP 安全策略阻拦

Open chvin opened this issue 3 years ago • 1 comments

bug 说明

将下面代码插入到 lowcode-demo 项目 index.ejs 文件 head 标签中即可出现

<meta http-equiv="Content-Security-Policy" content="script-src 'unsafe-eval' https: http: 'nonce-abcd';" />

image

image

异常具体指向这一行

对于页面 HTTP 头有 content-security-policy 设置的,会同样出现上述问题。所以此问题常常是本地开发好了,生产环境挂了 image

期望

Google 对于 document.write 的说明:https://developer.chrome.com/blog/removing-document-write/

期望取消 document.write 的使用,PR 在下方。

chvin avatar Sep 16 '22 10:09 chvin

具体什么场景要使用这种 CSP 策略啊?

LeoYuan avatar Sep 21 '22 02:09 LeoYuan