Change MIME mapping for .js from application/javascript to text/javascript

This application/javascript MIME type is deprecated.

This commit therefore changes the MIME type mapping for *.js files from
application/javascript to text/javascript in order to align with
industry standards.

Closes gh-33197
This commit is contained in:
Sam Brannen
2024-07-12 18:15:18 +02:00
parent 59b9404956
commit 3e48498663
6 changed files with 12 additions and 13 deletions

View File

@@ -30,7 +30,7 @@ class MediaTypeFactoryTests {
@Test
void getMediaType() {
assertThat(MediaTypeFactory.getMediaType("file.xml")).contains(MediaType.APPLICATION_XML);
assertThat(MediaTypeFactory.getMediaType("file.js")).contains(MediaType.parseMediaType("application/javascript"));
assertThat(MediaTypeFactory.getMediaType("file.js")).contains(MediaType.parseMediaType("text/javascript"));
assertThat(MediaTypeFactory.getMediaType("file.css")).contains(MediaType.parseMediaType("text/css"));
assertThat(MediaTypeFactory.getMediaType("file.foobar")).isNotPresent();
}