Refused to execute script from '...' because its MIME type ('') is not executable, and strict MIME type checking is enabled.
写在前面
部署项目到weblogic上启动首页访问空白, 浏览器控制台报如题错误. web.xml中把响应头添加防止攻击的报文过滤器禁用就行了(仅仅是为了启动), 以下为转载内容, 可以根据需要自行测试.
正文(转载)
今天在是用公司的报表插件Stimulsoft时发现的问题。之前可以正常使用,突然不能加载了。查看发现得到这个错误。

查看请求头

可以看到,请求正常响应,但是发现 Content-Type是空的,但是引入了X-Content-Type-Options。
X-Content-Type-Options 响应首部相当于一个提示标志,被服务器用来提示客户端一定要遵循在 Content-Type 首部中对 MIME 类型 的设定,而不能对其进行修改。这就禁用了客户端的 MIME 类型嗅探行为,换句话说,也就是意味着网站管理员确定自己的设置没有问题。
查询之后,发现是最近在web.xml中加入了HttpHeaderSecurityFilter导致的。
<filter>
<filter-name>httpHeaderSecurity</filter-name>
<filter-class>org.apache.catalina.filters.HttpHeaderSecurityFilter</filter-class>
<async-supported>true</async-supported>
</filter>
那么禁用这个特性,需要修改为
<filter>
<filter-name>httpHeaderSecurity</filter-name>
<filter-class>org.apache.catalina.filters.HttpHeaderSecurityFilter</filter-class>
<async-supported>true</async-supported>
<init-param>
<param-name>blockContentTypeSniffingEnabled</param-name>
<param-value>false</param-value>
</init-param>
</filter>
参考链接 http://www.jackieathome.net/archives/369.html?utm_source=tuicool&utm_medium=referral
感谢
Refused to execute script from '...' because its MIME type ('') is not executable, and strict MIME type checking is enabled.的更多相关文章
- 对于错误“Refused to execute script from '...' because its MIME type ('') is not executable, and strict MIME type checking is enabled.”的处理。
今天在是用公司的报表插件Stimulsoft时发现的问题.之前可以正常使用,突然不能加载了.查看发现得到这个错误. 查看请求头 可以看到,请求正常响应,但是发现 Content-Type是空的,但是引 ...
- Refused to execute script from '....js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.md
目录 问题描述 解决过程 总结 问题描述 在整合 Spring Boot.Spring Security.Thymeleaf 的练习中,对页面进行调试时,发现如下错误提示: Refused to ex ...
- because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled
spring security 配置问题,静态资源未被允许访问
- [Matlab] Attempt to execute SCRIPT *** as a function
Attempt to execute SCRIPT *** as a function 问题: 在运行MATLAB程序的时候,出现如题的报错. 原因: 在系统中,现有的.m文件有的与***函数重名,所 ...
- Refused to execute inline event handler because it violates the following Content Security Policy directive: "xxx". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...')
/********************************************************************************* * Refused to exec ...
- matlab: Attempt to execute SCRIPT *** as a function 错误
编写matlab程序时,出现了“Attempt to execute SCRIPT mean as a function”,其实这是“Attempt to execute SCRIPT *** as ...
- 【解决】MacOS下 Python3.7 使用 pyinstaller 打包后执行报错 Failed to execute script pyi_rth__tkinter
Fix tcl/tk libs inclusion in tkinter with Python3.7 under MacOS 使用 Pyinstaller 打包时候报错 3027 ERROR: Tc ...
- Pyinstaller 打包exe 报错 "failed to execute script XXX"的一种解决方案
最近用PyQt5写了一个界面小程序,需要打包成exe给到其他windows上使用,一开始使用python 3.7 64位,用pyinstaller打包exe,在64位机上运行正常. 但是目标电脑是32 ...
- 【Python】pyinstaller打包运行报错failed to execute script main
前言 最近用pyinstaller打包的时候一直报"failed to execute script main". 最终使用"pyinstaller --hidden-i ...
随机推荐
- Java 字符串(一)字符串初始化
一.String类概述 1.概述 java.lang.String 类代表字符串.Java程序中所有的字符串文字(例如 "abc" )都可以被看作是实现此类的实例.String 是 ...
- adb shell get/setprop, setenforce...
adb shell getprop <key> 获取设备参数信息adb shell setprop <key> <value> 设置设备参数信息 例子1:>C ...
- Java 使用properties配置文件加载配置
一般我们不把数据库的配置信息写死在代码中. 写好代码后,编译.调试,成功后只把输出目录中的东西(jar包..class文件.资源文件等)拷贝到服务器上,由运维来管理.服务器上是没有源文件的(.java ...
- Golang: 解析JSON数据之三
前面我们介绍了 Marshal 和 Unmarshal 方法,今天再解一下另外两个 API:Encoder 和 Decoder. Encoder Encoder 主要负责将结构对象编码成 JSON 数 ...
- 2015年br运维操作归档
归档2015年在br做运维时常用的命令,主要梳理出log的过滤操作. 对于日志文本的处理,常见还是sed和awk,具体如下: 统计ip访问量: cat nginx.log |awk '{print $ ...
- Mac pro操作快捷键
1. 在Finder顶部显示文件/文件夹全路径 终端里输入:defaults write com.apple.finder _FXShowPosixPathInTitle -bool TRUE;kil ...
- HTTP认识
一.相关名词解释 1. 超文本:是指包含指向其他文档的超链接的文本 2. 万维网:简称web,是一个分布式的超媒体系统,它是超文本系统的扩充,以客户-服务器方式工作 3. 超媒体:文档包含文本,图片, ...
- 性能测试基础---事务&检查点&思考时间&集合点
性能测试脚本的增强:·参数化·关联·事务·检查点·思考时间·集合点 ·事务:事务的引入是为了度量相关的业务请求的响应时间和吞吐量指标.在LR中,事务是通过两个事务函数来实现的. lr_start_tr ...
- vue-router有哪几种导航钩子?(具体怎么用的)
三种,第一种:是全局导航钩子:router.beforeEach(to,from,next),作用:跳转前进行判断拦截.第二种:组件内的钩子第三种:单独路由独享组件 .
- reactnative 笔记
1.<FlatList/> _renderItem = ({item})=>{ return <View style={[styles.part4Row]}> <T ...