浏览器警告Failed to decode downloaded font和OTS parsing error: Failed to convert *** font to ***
昨晚,在做一个自己感兴趣的东西时,发现浏览器报警告,Failed to decode downloaded font以及OTS parsing error: Failed to convert *** font to ***。
但是这个问题从来没有遇到过,在网上找了一会儿答案后,发现了类似的问题回答下有网友猜测是拦截器没通过,所以我检查了shiro的拦截配置:
<property name="filterChainDefinitions">
<value>
/=authc
/index=authc
/logout=logout
/assets/** = anon
/css/** = anon
/fonts/**=anon
/img/**=anon
/**= user
</value>
</property>
但是这个配置理论上是没问题的,所以不是这个问题。
今天在查阅了一些资料后,发现了可能的原因:
在maven的filter解析font文件时,它破坏了font文件的二进制文件格式,导致浏览器解析出错。
解决的思路是:font文件不需要filter,因此我们需要在配置中设置一下(SpringBoot在pom.xml中写入):
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
<resources>
<!-- fonts file cannot use filter as the data structure of byte file will be changed via filter -->
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<excludes>
<exclude>static/fonts/**</exclude>
</excludes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<includes>
<include>static/fonts/**</include>
</includes>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
</build>
在经如上所示的配置后,maven在编译项目时不解析font文件,浏览器就不会报警告,字体也可以正常显示。
浏览器警告Failed to decode downloaded font和OTS parsing error: Failed to convert *** font to ***的更多相关文章
- Spring Boot + Bootstrap 出现"Failed to decode downloaded font"和"OTS parsing error: Failed to convert WOFF 2.0 font to SFNT"
准确来讲,应该是maven项目使用Bootstrap时,出现 "Failed to decode downloaded font"和"OTS parsing error: ...
- Spring Boot - Font Awesome OTS parsing error: Failed to convert 字体加载失败
字体文件,加载不出来 解决方案 一 问题是Maven正在过滤字体文件并破坏它们. <resource> <directory>${project.basedir}/src/m ...
- 处理springboot OTS parsing error: Failed to convert WOFF 2.0 font to SFNT
springboot项目中添加了字体等文件后,页面无法识别,浏览器调试窗口报错如下: Failed to decode downloaded font: http://localhost:8080/f ...
- 解决Spring Boot OTS parsing error: Failed to convert WOFF 2.0
<build> <resources> <resource> <directory>${project.basedir}/src/main/resour ...
- chrome浏览器警告:Failed to decode downloaded font:
使用iconfont字体时chrome报错 Failed to decode downloaded font: 在服务器设置一下自己定义MIME类型. 扩展名: .woff Mime类型:applic ...
- Failed to decode downloaded font
碰到如下错误,该错误是开启layui的打印.导出.筛选列时出现的,不能正常显示图标及文字 原因: @参考文章 因为经过maven的filter,会破坏font文件的二进制文件格式,到时前台解析出错 解 ...
- 记一次elementUI Icon 加载无效的问题。并且提示错误 Failed to decode downloaded font:
问题在于webpack的loader中.检查了一下发现有两个相同的file-loader的配置,删除其中一个即可.
- URIError: Failed to decode param '/%PUBLIC_URL%/favicon.ico'
今天搭建antd的项目结构,本来项目是一个基础react项目,结果执行 yarn create umi yarn yarn start 项目启动后访问突然报错URIError: Failed to d ...
- composer 报错:Failed to decode response: zlib_decode(): data error 解决办法
执行命令 composer require particle/validator 报错 Failed to decode response: zlib_decode(): data error 网上推 ...
随机推荐
- PHP性能监控
使用xhprof进行线上PHP性能追踪及分析 日志未经声明,均为AlloVince原创.版权采用『 知识共享署名-非商业性使用 2.5 许可协议』进行许可. 之前一直使用基于Xdebug进行PHP的性 ...
- jQuery 工具类函数-检测浏览器是否属于W3C盒子模型
浏览器的盒子模型分为两类,一类为标准的w3c盒子模型,另一类为IE盒子模型,两者区别为在Width和Height这两个属性值中是否包含padding和border的值,w3c盒子模型不包含,IE盒子模 ...
- jquery超级简单的后台系统自适应框架
系统后台自适应简单框架 <!DOCTYPE HTML> <html lang="zh-CN"> <head> <meta http-equ ...
- spring的69个问题
1.什么是Spring? Spring是一个开源的Java EE开发框架.Spring框架的核心功能可以应用在任何Java应用程序中,但对Java EE平台上的Web应用程序有更好的扩展性.Sprin ...
- 2019-10-12-win10-uwp-非ui线程访问-ui-
title author date CreateTime categories win10 uwp 非ui线程访问 ui lindexi 2019-10-12 15:0:12 +0800 2018-2 ...
- java 如何重写equals
java中重写equals表面上看只涉及equals与hashCode两个方法,但如果仔细考虑发现重写一个逻辑完整的equals并不容易,需要考虑克隆,继承(多态)等问题,下面是最近的几点心得 1.先 ...
- windows下使用cmake+mingw配置makefile
前面一节说了cmake简易使用,但是实际开发中项目文件非常多,使用哪种简易方式会导致代码十分混乱,因此本文介绍一种cmake管理大型项目的demo流程. 具体步骤如下: 1.创建相关的项目目录 cmd ...
- 关于instanface的问题
nstanceof关键字来判断某个对象是否属于某种数据类型.报错 代码如下 package cn.lijun.demo3; import cn.lijun.demo.Person;import cn ...
- 前端——jQuery介绍
目录 jQuery介绍 jQuery的优势 jQuery内容: jQuery版本 jQuery对象 jQuery基础语法 查找标签 基本选择器 层级选择器: 基本筛选器: 属性选择器: 表单筛选器: ...
- mongodb安装及安装MongoDB报错Verify that you have sufficient privileges to start system services解决方法
1.点击安装包mongodb-win32-x86_64-2012plus-4.2.2-signed进行安装 2.点击next 3.接受协议,点击next 4.点击自定义安装 选择安装路径,建议默认C盘 ...