拒绝加载图像,因为它违反了以下内容安全策略指令(favicon) [英] Refused to load the image because it violates the following Content Security Policy directive (favicon)

查看:1506
本文介绍了拒绝加载图像,因为它违反了以下内容安全策略指令(favicon)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

启动服务器时,出现以下错误:

When I start the server I get the following error:

拒绝加载图片" http://localhost:4200/favicon.ico ",因为 它违反了以下内容安全策略"指令: "default-src'none'".请注意,未明确设置"img-src",因此 'default-src'用作后备.

Refused to load the image 'http://localhost:4200/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.

我没有更改网站图标或其他任何内容,默认情况下都是这样.

I haven't changed the favicon or anything, it's all by default.

推荐答案

我来这里是为了找到相同问题的答案,但我自己解决了.我的应用程序出现了一个角度编译错误(我没有运行ng build),上面的错误掩盖了这个问题.我错过了在解析器中使用的对象的某些属性.

I came here to find an answer to the same question but I solved it myself. I had an angular compilation error in my app (I hadn't run ng build) and the error above was masking this problem. I had missed some properties on an object I was using in a resolver.

我正在运行Angular〜7.x

I'm running Angular ~7.x

这篇关于拒绝加载图像,因为它违反了以下内容安全策略指令(favicon)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆