Resource interpreted as Stylesheet but transferred with MIME type application/octet-stream
来源:互联网 发布:淘宝授权书psd模板 编辑:程序博客网 时间:2024/06/11 09:51
最近在重构项目,主要用了spring boot,同时打算加上swagger便于测试,结果在搭建过程中发现一个css文件无法加载的坑,具体如下:
能加载出页面,但是css样式加载不成功,看了下console信息,提示如下
可见css样式的mime type被设置成了application/octet-stream,而不是text/css,本以为是过滤器把css过滤掉了,结果抓包发现返回没有问题,那剩下的情况只能是response设置mime type的时候出问题了,逐步调试发现
PathExtensionContentNegotiationStrategy.java中根据css获取mimeType失败:
发现fileTypeMap中的"mimetype从org/springframework/mail/javamail/mime.types"中获取mimeType类型,这个文件在spring-context-support包中,检查了下pom.xml果然没有引用这个包,加上这个包的依赖后问题解决。
阅读全文
0 0
- Resource interpreted as Stylesheet but transferred with MIME type application/octet-stream
- SpringMVC Resource interpreted as Script but transferred with MIME type application/octet-stream:
- Resource interpreted as Stylesheet but transferred with MIME type application/x-css
- Resource interpreted as Stylesheet but transferred with MIME type text/html:以及Uncaught SyntaxError:
- Java过滤器引发的异常:Resource interpreted as Stylesheet but transferred with MIME type text/html
- Resource interpreted as Stylesheet but transferred with MIME type text/plain
- 关于easyui Resource interpreted as Document but transferred with MIME type application/json
- Resource interpreted as Font but transferred with MIME type application/x-font-woff
- Resource interpreted as Document but transferred with MIME type application/json ...
- ThinkPHP Resource interpreted as Document but transferred with MIME type application/json 导致js无效
- Resource interpreted as Document but transferred with MIME type application/json:
- 样式加载不出来,浏览器控制台报错:Resource interpreted as Stylesheet but transferred with MIME type text/html
- 关于chrome Resource interpreted as Script but transferred with MIME type text/html的问题
- 关于chrome Resource interpreted as Script but transferred with MIME type text/html的问题
- golange 错误如下 Resource interpreted as Script but transferred with MIME type text
- Resource interpreted as Image but transferred with MIME type text/plain 警告解决方案
- Chrome 报 Resource interpreted as Script but transferred with MIME type text/plain 警告的解决办法
- Resource interpreted as Script but transferred with MIME type text/html
- 前端能力学习进度
- react里使用less时antd报错
- Code Control MVC框架-保存和加载模型
- Trie树
- 【CF】Codeforces Round #423(Div.1)
- Resource interpreted as Stylesheet but transferred with MIME type application/octet-stream
- Lamda表达式,从抵制到喜欢
- 关于协方差矩阵
- 中国IT风险投资机构
- VTK交互-观察者/命令模式
- Git合并分支(下)
- 牛客练习赛8,给个n,求1到n的所有数的约数个数的和~
- 人到了32岁就有自己的工作方法了吗
- 2296: 【POJ Challenge】随机种子