简体   繁体   English

“style-src 'self' https://maxcdn.bootstrapcdn.com/bootstrap/”。 'unsafe-inline' 关键字,一个散列

[英]"style-src 'self' https://maxcdn.bootstrapcdn.com/bootstrap/". Either the 'unsafe-inline' keyword, a hash

I have a webpage hosted on jenkins server.我在 jenkins 服务器上托管了一个网页。

I saw that in the latest jenkins update there was我看到在最新的詹金斯更新中有

So I have read this fantastic post on how to bypass this restriction所以我已经阅读了这篇关于如何绕过这个限制的精彩文章

I have added this <meta> to my page我已将此<meta>添加到我的页面

but i keep on getting console errors:但我不断收到控制台错误:

Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self' https://maxcdn.bootstrapcdn.com/bootstrap/ ".拒绝应用内联样式,因为它违反了以下内容安全策略指令:“style-src 'self' https://maxcdn.bootstrapcdn.com/bootstrap/ ”。 Either the 'unsafe-inline' keyword, a hash ('sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='), or a nonce ('nonce-...') is required to enable inline execution.启用内联执行需要“unsafe-inline”关键字、哈希(“sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=”)或随机数(“nonce-...”)。

    <head>
<title>Bidi: unknown bl version vs. 1.0.487</title>
<meta content="text/html; charset=utf-8 ;" http-equiv="content-type">
<meta content="style-src 'self' https://maxcdn.bootstrapcdn.com/bootstrap/" http-equiv="Content-Security-Policy"><meta content="script-src 'self' https://maxcdn.bootstrapcdn.com/bootstrap/" http-equiv="Content-Security-Policy"><meta content="default-src 'self' https://maxcdn.bootstrapcdn.com/bootstrap/" http-equiv="Content-Security-Policy"><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css"><script type="script" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script><link rel="icon" href="/jenkins/view/QA/job/RoutingRegression/ws/src/main/resources/html_pages/images/favicon.png" type="image/gif" sizes="16x16"><link rel="stylesheet" href="/RoutingRegression/html_pages/css/delta_samples.css">
</head>

在此处输入图片说明

I think you should read this fantastic post I fully relaxed my Jenkins config by using我认为你应该阅读这篇精彩的文章,我通过使用完全放松了我的 Jenkins 配置

System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "") System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "")

Add 'unsafe-inline' attribute to the metadata.向元数据添加“unsafe-inline”属性。

<meta content="style-src 'self' 'unsafe-inline' https://maxcdn.bootstrapcdn.com/bootstrap/" http-equiv="Content-Security-Policy">
<meta content="script-src 'self' 'unsafe-inline' https://maxcdn.bootstrapcdn.com/bootstrap/" http-equiv="Content-Security-Policy">

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 拒绝加载脚本,因为它违反了以下内容安全策略指令:“style-src 'self' 'unsafe-inline' - Refused to load the script because it violates the following Content Security Policy directive: "style-src 'self' 'unsafe-inline' CSP-当动态放置页面元素时,如何解决style-src unsafe-inline - CSP - How to solve style-src unsafe-inline -when having dynamically positioned page elements 使用没有 style-src &#39;unsafe-inline&#39; 的 ACE Web-Editor - Use the ACE Web-Editor without style-src 'unsafe-inline' 如何添加“unsafe-inline”关键字来运行内联 javascript? - How to add 'unsafe-inline' keyword to run inline javascript? 如果声明了哈希,Chrome是否应该忽略unsafe-inline指令? - Is Chrome supposed to ignore the unsafe-inline directive if a hash is declared? 除了在CSP策略中添加“ unsafe-inline”以添加内联样式attr之外,setAttribute()是否还有其他选择? - Is there any alternative to setAttribute() other than adding 'unsafe-inline' in CSP policy for adding inline style attr? 使用 Content-Security-Policy 和 JavaScript 避免 `script-src 'unsafe-inline'` - Avoiding `script-src 'unsafe-inline'` with Content-Security-Policy and JavaScript 拒绝执行脚本,因为它的哈希、随机数或“不安全内联”错误 - Refused to execute a script because its hash, its nonce, or 'unsafe-inline' Error CSP 标头的 nonce 和 hash 之间哪个指令更好以避免不安全的内联? - Which directive is better between nonce and hash for CSP header to avoid unsafe-inline? 因为它违反了以下内容安全策略指令:“style-src&#39;self&#39;” - because it violates the following Content Security Policy directive: “style-src 'self'”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM