zoukankan      html  css  js  c++  java
  • 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

     

    感谢

  • 相关阅读:
    nginx location 语法
    nginx 日志文件
    nginx 配置文件详解
    mysql分区partition
    MySQL跳过密码登录
    min/max优化,count ,group by
    in型子查询陷阱,exists子查询
    explain分析sql效果
    HDU2896 病毒侵袭 —— AC自动机
    二分图之 多重匹配 和 最大权匹配 等总结
  • 原文地址:https://www.cnblogs.com/yadongliang/p/11868368.html
Copyright © 2011-2022 走看看