使用cordova 压缩图片时出现的CSP问题
引入一个压缩插件时, 上传的附件需要file或blob格式, 运行时一直报错
<meta http-equiv="Content-Security-Policy" content="default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: gap:">
Refused to load the image blob:'http://xxx.png'
because it violates the following Content Security Policy directive: "default-src 'self'
data: gap:
Note that 'img-src' was not explicitly set
看了一些文章后改成
<meta http-equiv="Content-Security-Policy" content="default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: gap:; img-src * data: ">
结果还是不行. 继续报错
Refused to load the image blob:'http://xxx.png'
because it violates the following Content Security Policy directive: "default-src 'self'
data: gap: img-src * data:
because it violates the following Content Security Policy directive: "default-src 'self'
data: gap: img-src * data:
找了半天 最后搜mdn才知道 原来属性是可以有多个的.

浙公网安备 33010602011771号