我收到此错误:
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 地图时。这是我的 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:">
原文由 Raz Buchnik 发布,翻译遵循 CC BY-SA 4.0 许可协议
这是图像和 base64 的修复。
需要添加
img-src 'self' blob: data:;
如下: