我收到此错误:
Refused to load the image 'blob:file:///cf368042-bf23-42b6-b07c-54189d3b0e01' because it violates the following Content Security Policy directive: "default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: gap: content:". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.
在尝试加载 mapboxGL map 时。
这是我的 CSP 标签:
<meta http-equiv="Content-Security-Policy"
content="
worker-src blob:;
child-src blob: gap:;
default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: gap: content:">
最佳答案
这是图像和 base64 的修复程序。
需要加img-src 'self' blob: data:;
如下:
<meta http-equiv="Content-Security-Policy"
content="
worker-src blob:;
child-src blob: gap:;
img-src 'self' blob: data:;
default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: gap: content:">
关于html - 拒绝加载图像 'blob:...' 因为它违反了以下内容安全策略,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59484216/