Please sign in to comment.
Relax SPR-13867 changes for ResourceHttpRequestHandler
Prior to this change, SPR-13867 made sure that any class extending WebContentGenerator would not overwrite existing HTTP "Cache-Control" response headers - set by a filter, a Controller handler, etc. This caused issues with resource handling, since specifying a cache configuration there would not overwrite default headers set by filters, for example by Spring Security. This commit restricts the previous changes to the RequestMappingHandlerAdapter, in order to avoid overwriting header set by a filter or a Controller handler in those cases. Issue: SPR-14005 Cherry-picked from 50bcd67
- Loading branch information
Showing with 48 additions and 39 deletions.
- +8 −6 ...main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerAdapter.java
- +29 −33 spring-webmvc/src/main/java/org/springframework/web/servlet/support/WebContentGenerator.java
- +11 −0 ...ebmvc/src/test/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandlerTests.java