![](/img/trans.png)
[英]Refused to load the script because it violates the following Content Security Policy directive: "style-src 'self' 'unsafe-inline'
[英]Refused to load the stylesheet because it violates the following Content Security Policy directive: "style-src 'self' 'unsafe-inline'"
我正在嘗試加載使用第三方工具創建的外部彈出表單。 我不斷收到有關 CSP 違規的錯誤消息。 問題是我可以在本地正確加載它們,並且只有當我將它們部署在我的提供商的服務器上時它們才會被阻止。 我不知道這些策略來自哪里,因為我沒有在 .htaccess 文件(帶有 codeigniter 的 PHP Web 應用程序)中定義任何內容,我檢查了所有相關答案,但對我沒有任何幫助。
因為它違反了以下內容安全策略指令:“style-src 'self'”
我也嘗試了幾個版本的<meta http-equiv="Content-Security-Policy"
但還是沒有運氣。
它需要在服務器端進行修復。 請更新服務器上的策略。
您在元標記中缺少style-src。
<meta http-equiv="Content-Security-Policy" content="style-src 'self' https://domaingoeshere.com/css/fonts.css 'unsafe-inline' 'unsafe-eval'">
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.