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

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -64,7 +64,7 @@ public class WebSpringJupiterTests {
void resources() throws Exception {
this.mockMvc.perform(get("/resources/Spring.js"))
.andExpectAll(
content().contentType("application/javascript"),
content().contentType("text/javascript"),
content().string(containsString("Spring={};"))
);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -69,7 +69,7 @@ public class WebAppResourceTests {
testClient.get().uri("/resources/Spring.js")
.exchange()
.expectStatus().isOk()
.expectHeader().contentType("application/javascript")
.expectHeader().contentType("text/javascript")
.expectBody(String.class).value(containsString("Spring={};"));
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -67,7 +67,7 @@ public class WebAppResourceTests {
@Test
public void resourceRequest() throws Exception {
this.mockMvc.perform(get("/resources/Spring.js"))
.andExpect(content().contentType("application/javascript"))
.andExpect(content().contentType("text/javascript"))
.andExpect(content().string(containsString("Spring={};")));
}