Merge branch '2.4.x'

Closes gh-26233
This commit is contained in:
Brian Clozel 2021-04-26 11:37:20 +02:00
commit 1732d8ccf7
2 changed files with 2 additions and 1 deletions

View File

@ -426,6 +426,7 @@ public class WebMvcAutoConfiguration {
customizer.accept(registration);
registration.setCachePeriod(getSeconds(this.resourceProperties.getCache().getPeriod()));
registration.setCacheControl(this.resourceProperties.getCache().getCachecontrol().toHttpCacheControl());
registration.setUseLastModified(this.resourceProperties.getCache().isUseLastModified());
customizeResourceHandlerRegistration(registration);
}

View File

@ -1009,7 +1009,7 @@ class WebMvcAutoConfigurationTests {
Consumer<ResourceHttpRequestHandler> handlerConsumer) {
Map<String, Object> handlerMap = getHandlerMap(context.getBean("resourceHandlerMapping", HandlerMapping.class));
assertThat(handlerMap).hasSize(2);
for (Object handler : handlerMap.keySet()) {
for (Object handler : handlerMap.values()) {
if (handler instanceof ResourceHttpRequestHandler) {
handlerConsumer.accept((ResourceHttpRequestHandler) handler);
}