![](/img/trans.png)
[英]Content-Security-Policy will not load images from external sources in React
[英]Content Security Policy preventing images from loading
我有一个正在加载一些外部资产的快速应用程序,但它们被 CSP 阻止。 我以前从未遇到过这个问题,但这是我第一次在应用程序中使用passport.js 和helm.js 所以这可能与他们的配置有关吗?
Refused to load the image 'https://fake-url.com' because it violates the following Content Security Policy directive: "img-src 'self' data:".
我尝试添加一个元标记以允许来自外部来源的图像,但这似乎没有效果。 任何帮助,将不胜感激。
你有
content="default-src 'none'
这可以防止从任何来源加载资源。 去掉它。
然后将其更改为:
default-src 'self' fake-url.com';
有关以下 HTTP Content-Security-Policy响应标头的更多信息:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.