【发布时间】:2020-04-16 10:45:09
【问题描述】:
我收到了这个错误:
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:">
【问题讨论】:
-
将 'img-src blob:' 添加到 Content-Security-Policy 值。或者将 'blob:' 添加到现有的 'default-src' 值。
标签: html mapbox content-security-policy