Refused to load the script because it violates the following Content Security Policy directive: "style-src 'self' 'unsafe-inline'

后端 未结 4 1748
陌清茗
陌清茗 2020-12-30 01:49

I am using MVC6 (asp.net 5) using angular and trying to load scripts from CDN locations when my code is running in release mode, but for some reason the scripts NEVER load.<

4条回答
  •  一生所求
    2020-12-30 02:14

    In my case, this policy is set via SecurityHeadersAttribute (this attribute is set in AccountController and some others).

    Basically, this adds default policy in the headers that overwrite your meta tag. So you need to change this policy or remove the attribute from Controller.

提交回复
热议问题