playframework 2.6 refused to apply inline style because it violates the following Content Security
今天在做文件上传的时候,出现了下面的错误:
Refused to apply inline style because it violates the following Content Security Policy directive: "default-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-4Su6mBWzEIFnH4pAGMOuaeBrstwJN4Z3pq/s1Kn4/KQ='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'style-src' was not explicitly set, so 'default-src' is used as a fallback.
伤透了脑筋,就是图片上传上去了,返回url的时候被拦截了,这是play里面的拦截引起的。
解决方法
在application.conf的headers里面加上这句:
# The Content-Security-Policy header. If null, the header is not set.contentSecurityPolicy = "default-src 'self' 'unsafe-inline'"
参考文献
[1]. Refused to apply inline style because it violates the following Content Security Policy directive. https://stackoverflow.com/questions/17766817/refused-to-apply-inline-style-because-it-violates-the-following-content-security
playframework 2.6 refused to apply inline style because it violates the following Content Security相关推荐
- Refused to execute inline script because it violates the following Content Security Policy directive
版权声明 本文原创作者:谷哥的小弟 作者博客地址:http://blog.csdn.net/lfdfhl 问题描述 在利用表单向后台提交数据时,前端页面报错: Refused to execute i ...
- Refused to load the image 'URL' because it violates the following content security polity diretive
转载地址:https://www.cnblogs.com/xiaoxiaoluoye/p/6945044.html 深入学习地址:https://www.cnblogs.com/Hwangzhiyou ...
- uni-app - Refused to display ‘xxx‘ in a frame because an ancestor violates the following Content Sec
报错原因 整体流程的话,就是将网页通过 web-view 组件内嵌到 App 中(非小程序),其中有跳转微信公众号的需求,不料却收到了以下报错. 我又不是打包小程序,就套壳个 App ,比较疑惑为什么 ...
- Refused to apply style from ‘http://localhost:8080/iconfont.css‘ because its MIME type (‘text/html‘
Refused to apply style from 'http://localhost:8080/iconfont.css' because its MIME type ('text/html') ...
- Electron中提示:Refused to execute inline event handler because it violates
场景 在Electron中点击index.html中的button按钮时想要其触发renderer.js的方法. 在index.html中 <button onclick="getPr ...
- 前端学习(2491):refused to apply style from ‘‘ because its MIME type (‘text/html‘) is not a supported sty
<link type="text/css" rel="stylesheet" href="./main.css"> 加个type ...
- Refused to apply style from ‘http://localhost:63342/.../user.css‘ because its MIME type(‘text/html‘)
HTML文件引用的css文件始终不生效,报这个错. 原因:引用的.css文件的href路径写错了.
- Jenkins运行selenium自动化测试脚本
前提 1.Ubuntu上运行selenium的pytest脚本,已经成功运行 https://blog.csdn.net/weixin_43431593/article/details/1186359 ...
- web高德maker动画_Web Maker —我如何构建一个快速的离线前端游乐场
web高德maker动画 by kushagra gour 由kushagra gour Web Maker -我如何构建一个快速的离线前端游乐场 (Web Maker - How I built a ...
- DVWA全关教程手册
搭建 使用phpstudy 放入根目录下 C:\phpstudy\PHPTutorial\WWW 修改两个配置文件 C:\phpstudy\PHPTutorial\WWW\DVWA\php.ini m ...
最新文章
- Fastcgi是什么
- Isolation Forest原理总结
- c++ 截取\r\n问题
- Basic操作系统概念梳理
- C和指针之字符串strspn、strcspn函数源代码的实现
- Tomcat上下文JUnit @Rule
- CentOS7.2中安装rabbitmq
- 那些除夕夜还在上BOSS直聘的人
- nodejs模块hashmap
- paddlepaddle的使用
- Play Framework + ReactiveMongo 环境搭建
- 创建区块计算次数_以太坊创建者Vitalik Buterin为飙升的ETH交易费用提供扩展解决方案...
- Python代码自动转成C++代码
- Word控件Spire.Doc 转换教程(三):如何将 Word 转换为 PDF
- 洛谷P1512伊甸园的日历游戏题解
- javax.mail.MessagingException: Unknown SMTP host: smtp.163.com;
- Twitter是什么软件?哪个国家的?怎么使用?免费吗?
- 什么击计算机窗口可以打开资源管理器,Win8系统打开资源管理器窗口经常自动重启电脑解决措施...
- 惠普HP Deskjet F4238 多功能一体机驱动
- 相机平面与工作平面带夹角下的坐标换算