Loading of a resource blocked by Content Security Policy

后端 未结 2 2005
南笙
南笙 2020-12-06 17:54

I\'m getting the error below in the console of my browser:

Content Security Policy: The page’s settings blocked the loading of a resource at htt

2条回答
  •  孤城傲影
    2020-12-06 18:16

    • /favicon.ico is automatically loaded by the web browser in the absence of other URLs for the favicon. This is specified by: https://html.spec.whatwg.org/#rel-icon
    • You current Content-Security-Policy was blocking it. You need to use something like: Content-Security-Policy: img-src 'self'

    Ideally web browser shouldn't even try /favicon.ico when it would be blocked. After all, loading /favicon.ico is triggered by the web browser, not the developer. I patched chrome (version >= 88) to remove the error:

    https://chromium-review.googlesource.com/c/chromium/src/+/2438388


提交回复
热议问题