写在前面

部署项目到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.的更多相关文章

  1. 对于错误“Refused to execute script from '...' because its MIME type ('') is not executable, and strict MIME type checking is enabled.”的处理。

    今天在是用公司的报表插件Stimulsoft时发现的问题.之前可以正常使用,突然不能加载了.查看发现得到这个错误. 查看请求头 可以看到,请求正常响应,但是发现 Content-Type是空的,但是引 ...

  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. because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled

    spring security 配置问题,静态资源未被允许访问

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

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

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

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

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

  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. 【Python】pyinstaller打包运行报错failed to execute script main

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

随机推荐

  1. vim替换字符串

    1. s 命令来替换字符串 :s/vivian/sky/ #替换当前行第一个 vivian 为 sky :s/vivian/sky/g #替换当前行所有 vivian 为 sky :n,$s/vivi ...

  2. 5.2 odex文件

    odex是OptimizedDEX的缩写,是优化过的dex文件 odex两种存在方式: 1. 从apk程序中提取,和apk文件放在一起,后缀 odex,此类文件多是AndroidRom系统文件 2.  ...

  3. elasticsearch Terms Query 实现类似于sql in查询

    本文demo基于elasticsearch 5.1.1,  项目中使用的还是较早的版本 例如 import com.alibaba.fastjson.JSON; import org.elastics ...

  4. FormData使用方法详解

    FormData的主要用途有两个: 1.将form表单元素的name与value进行组合,实现表单数据的序列化,从而减少表单元素的拼接,提高工作效率. 2.异步上传文件 一.创建formData对象 ...

  5. H3C FAT AP

  6. SaltStack--接口salt-api

    SaltStack接口salt-api 介绍 参考官档参考官档 SaltStack官方提供有REST API格式的salt-api项目,将使salt与第三方系统集成变得更加简单. salt-api安装 ...

  7. django项目后台权限管理功能。

    对后台管理员进行分角色,分类别管理,每个管理员登录账号后只显示自己负责的权限范围. 创建后台管理数据库 models.py文件内 # 管理员表 class Superuser(models.Model ...

  8. html中的数据岛:利用DSO和javascript在html中动态加载和浏览xml数据

    1.DSO也叫做数据源对象,IE 4.0引入了DSO,在IE 5.0对DSO技术进行很大的扩展.以往如果数据是通过SQL语言对数据库进行查询得到的结果,那么就把它们存放在ADO(ActiveX Dat ...

  9. MyBatis-plus的入门学习

    MyBatis优势: Sql简单语句可以自由控制,更灵活,性能更高.. sql与代码分离,易于阅读和维护 提供xml标签,支持编写动态sql语句. 劣势: 简单crud操作还是写SQL 语句 xml中 ...

  10. C语言入门hello world

    1.安装软件 c语言开发工具众多,初学者推荐使用Dev-Cpp 5.6.3 TDM-GCC x64 4.8.1 Setup.exe:安装过程全部默认安装即可. 2.使用Dev-Cpp编写第一个入门实例 ...