今天在是用公司的报表插件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.”的处理。的更多相关文章

  1. Refused to execute script from '...' because its MIME type ('') is not executable, and strict MIME type checking is enabled.

    写在前面 部署项目到weblogic上启动首页访问空白, 浏览器控制台报如题错误. web.xml中把响应头添加防止攻击的报文过滤器禁用就行了(仅仅是为了启动), 以下为转载内容, 可以根据需要自行测 ...

  2. 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 ...

  3. matlab: Attempt to execute SCRIPT *** as a function 错误

    编写matlab程序时,出现了“Attempt to execute SCRIPT mean as a function”,其实这是“Attempt to execute SCRIPT *** as ...

  4. 【Python】pyinstaller打包运行报错failed to execute script main

    前言 最近用pyinstaller打包的时候一直报"failed to execute script main". 最终使用"pyinstaller --hidden-i ...

  5. [Matlab] Attempt to execute SCRIPT *** as a function

    Attempt to execute SCRIPT *** as a function 问题: 在运行MATLAB程序的时候,出现如题的报错. 原因: 在系统中,现有的.m文件有的与***函数重名,所 ...

  6. 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 ...

  7. 【解决】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 ...

  8. Pyinstaller 打包exe 报错 "failed to execute script XXX"的一种解决方案

    最近用PyQt5写了一个界面小程序,需要打包成exe给到其他windows上使用,一开始使用python 3.7 64位,用pyinstaller打包exe,在64位机上运行正常. 但是目标电脑是32 ...

  9. ARM架构安装Anaconda3出现错误:cannot execute binary file: Exec format error

    ARM架构安装Anaconda3出现错误:cannot execute binary file: Exec format error 原因是:安装包格式不对. 在Anaconda官网上只有x86(32 ...

随机推荐

  1. 聊聊Linux用户态驱动设计

    序言 设备驱动可以运行在内核态,也可以运行在用户态,用户态驱动的利弊网上有很多的讨论,而且有些还上升到政治性上,这里不再多做讨论.不管用户态驱动还是内核态驱动,他们都有各自的缺点.内核态驱动的问题是: ...

  2. python-正铉

    第一步:安装插件 pip install Numpypip install matploatlib 第二步 导入包 import numpy as np import matplotlib.pylot ...

  3. STL --> find()和find_if()

    find()和find_if() 一.find()函数 find(first, end, value); // 返回区间[first,end)中第一个值等于value的元素的位置.如果没有找到匹配元素 ...

  4. js前端读写文件的方法(json、excel)

    1.前端读取文件的实现 关键:利用文件上传对话框预览本地文件.利用FileReader读取文件 前端预览本地文件 <input tabindex="-1" id=" ...

  5. GLES2学习VBO和VAO的使用

    在GLES2中使用VBO和VAO对象,已经简单vs,ps绘制一个三角形. 1. 初始化操作代码,创建VBO.VAO,编译和链接shader program. void DebugApplication ...

  6. spring整合springmvc和hibernate

    上篇文章使用maven搭建了web环境,这篇来记录下如何使用spring整合springmvc和hibernate,亦即spring+springmvc+hibernate框架整合. 第一步:首先配置 ...

  7. 【java并发系列】Fork/Join任务(转)

    原文链接 当我们需要执行大量的小任务时,有经验的Java开发人员都会采用线程池来高效执行这些小任务.然而,有一种任务,例如,对超过1000万个元素的数组进行排序,这种任务本身可以并发执行,但如何拆解成 ...

  8. python web——Django架构

    环境:windows/linux/OS 需要的软件:Firefox 浏览器(别的也可以 不过firfox和python的webdriver兼容性好) git版本控制系统(使用前要配置 用户 编辑器可以 ...

  9. Beta冲刺第四天

    一.昨天的困难 没有困难. 二.今天进度 1.林洋洋:修复协作详情,日程详情日程类型显示纠正 2.黄腾达:修复管理者查看协作成员可以移除自己的问题,加入登录.注册表单按回车键就可直接完成操作的功能 3 ...

  10. 从0开始的LeetCode生活—9. Palindrome Number(回文数)

    题目大意: 判断输入的数字是不是回文数.所谓回文数就是正反读都一样的数字,比如说11,121,1221这样子的数字.负数不会是回文数. 解题思路: 思路一:如果这个数是负数,则返回false,否则用一 ...