對於錯誤「Refused to execute script from '...' because its MIME type ('') is not executable, and strict M

今天在是用公司的報表插件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

相關文章
相關標籤/搜索