今天在是用公司的报表插件Stimulsoft时发现的问题。以前能够正常使用,忽然不能加载了。查看发现获得这个错误。html
查看请求头web
能够看到,请求正常响应,可是发现 Content-Type是空的,可是引入了X-Content-Type-Options。apache
X-Content-Type-Options
响应首部至关于一个提示标志,被服务器用来提示客户端必定要遵循在 Content-Type
首部中对 MIME 类型 的设定,而不能对其进行修改。这就禁用了客户端的 MIME 类型嗅探行为,换句话说,也就是意味着网站管理员肯定本身的设置没有问题。 服务器
查询以后,发现是最近在web.xml中加入了HttpHeaderSecurityFilter致使的。async
<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=referralui