diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/MimeMappings.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/MimeMappings.java index b731532830..077348af41 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/MimeMappings.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/MimeMappings.java @@ -261,14 +261,14 @@ public sealed class MimeMappings implements Iterable { mappings.add("jpg", "image/jpeg"); mappings.add("js", "application/javascript"); mappings.add("json", "application/json"); - mappings.add("otf", "application/x-font-opentype"); + mappings.add("otf", "font/otf"); mappings.add("pdf", "application/pdf"); mappings.add("png", "image/png"); mappings.add("ps", "application/postscript"); mappings.add("tar", "application/x-tar"); mappings.add("tif", "image/tiff"); mappings.add("tiff", "image/tiff"); - mappings.add("ttf", "application/x-font-ttf"); + mappings.add("ttf", "font/ttf"); mappings.add("txt", "text/plain"); mappings.add("xht", "application/xhtml+xml"); mappings.add("xhtml", "application/xhtml+xml"); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/MimeMappingsTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/MimeMappingsTests.java index 0d84f76e80..60e4882693 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/MimeMappingsTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/MimeMappingsTests.java @@ -174,9 +174,11 @@ class MimeMappingsTests { @Test void commonMappingsAreSubsetOfAllMappings() { + MimeMappings defaultMappings = new DefaultMimeMappings(); MimeMappings commonMappings = (MimeMappings) ReflectionTestUtils.getField(DefaultMimeMappings.class, "COMMON"); + defaultMappings.getAll(); for (Mapping commonMapping : commonMappings) { - assertThat(MimeMappings.DEFAULT.get(commonMapping.getExtension())).isEqualTo(commonMapping.getMimeType()); + assertThat(defaultMappings.get(commonMapping.getExtension())).isEqualTo(commonMapping.getMimeType()); } }