Publish HTML Reporter ecause the document's frame is sandboxed and the 'allow-scripts 报错

旧城冷巷雨未停 提交于 2019-12-14 01:16:18

test report failed with error message ”because the document's frame is sandboxed and the 'allow-scripts' permission is not set.” after updating jenkins to 2.19.2

The new Content-Security-Policy HTTP response header helps you reduce XSS risks on modern browsers by declaring what dynamic resources are allowed to load via a HTTP Header.

 

Can setting Jenkins Content Security Policy by Run the Groovy script at at http://jenkinsServer:8080/script( can open the script on manage page).  

System.setProperty("hudson.model.DirectoryBrowserSupport.CSP","sandbox allow-scripts; default-src 'none';script-src 'unsafe-inline' http://code.jquery.com/jquery-2.1.0.min.js; img-src dohko.hpeswlab.net 'self' data: ; style-src 'unsafe-inline' 'self';");

For more information about CSP, Please refer to https://wiki.jenkins-ci.org/display/JENKINS/Configuring+Content+Security+Policy & https://content-security-policy.com/ .

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!