【发布时间】:2020-03-22 02:05:35
【问题描述】:
在 heroku 上上传 angular 8 应用程序后,我在构建中没有错误,但在控制台错误文本中。
Refused to load the image 'https://MYAPPLICATION.herokuapp.com/favicon.ico' because it violates the following Content Security Policy directive: "default-src 'none'". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.
MYAPPLICATION.herokuapp.com/:1 Failed to load resource: the server responded with a status of 404 (Not Found)
我花了很多时间试图解决这个问题,但没有成功。帮助?我阅读了其他人的解决方案,但没有任何帮助。如何
编辑编辑编辑:
所有消息错误
拒绝加载图像“https://MYAPP.herokuapp.com/favicon.ico”,因为它违反了以下内容安全策略指令:“default-src 'none'”。请注意,'img-src' 没有显式设置,因此 'default-src' 用作备用。
加载资源失败:服务器响应状态为 404(未找到)
已解决> 好的,我解决了这个问题。 我有来自后端的 Api Cors 问题,但我使用的是在 localhost 中工作的块 cors 扩展,但是项目何时转到服务器不起作用。我没有真正的错误消息。
【问题讨论】:
-
这与内容安全策略有关
-
@c_ogoo 好的怎么解决?