Remove Servlet-specific static locations
This commit removes the Servlet root context from the default values for the `spring.resources.static-locations` configuration property. Servlet and non-Servlet applications are sharing this property. The Servlet root context is automatically configured as a resource location for Spring MVC based applications. Closes gh-9240
This commit is contained in:
@@ -127,7 +127,7 @@ public class WebFluxAutoConfigurationTests {
|
||||
SimpleUrlHandlerMapping.class);
|
||||
assertThat(hm.getUrlMap().get("/**")).isInstanceOf(ResourceWebHandler.class);
|
||||
ResourceWebHandler staticHandler = (ResourceWebHandler) hm.getUrlMap().get("/**");
|
||||
assertThat(staticHandler.getLocations()).hasSize(5);
|
||||
assertThat(staticHandler.getLocations()).hasSize(4);
|
||||
assertThat(hm.getUrlMap().get("/webjars/**"))
|
||||
.isInstanceOf(ResourceWebHandler.class);
|
||||
ResourceWebHandler webjarsHandler = (ResourceWebHandler) hm.getUrlMap()
|
||||
@@ -146,7 +146,7 @@ public class WebFluxAutoConfigurationTests {
|
||||
.isInstanceOf(ResourceWebHandler.class);
|
||||
ResourceWebHandler staticHandler = (ResourceWebHandler) hm.getUrlMap()
|
||||
.get("/static/**");
|
||||
assertThat(staticHandler.getLocations()).hasSize(5);
|
||||
assertThat(staticHandler.getLocations()).hasSize(4);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -442,7 +442,7 @@ public class WebMvcAutoConfigurationTests {
|
||||
.withPropertyValues("spring.resources.static-locations=classpath:/static")
|
||||
.run((context) -> assertThat(
|
||||
getFaviconMappingLocations(context).get("/**/favicon.ico"))
|
||||
.hasSize(2));
|
||||
.hasSize(3));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user