Description
Jan Gaedicke opened SPR-13717 and commented
As we updated our spring dependencies from 4.0.8.RELEASE to 4.2.3.RELEASE the ShallowEtagHeaderFilter stopped working for spring controller methods that return a ResponseEntity. The effect is that no "Etag" header is added to the response.
The problem is, that the HttpEntityMethodProcessor flushes the HttpServletResponse and the ShallowEtagHeaderFilter refuses to add the header if the response is committed.
As a workaround we have implemented the flushBuffer method in the ContentCachingResponseWrapper and delay the original flushBuffer call until copyBodyToResponse is called.
You can find a small spring-boot app using a tomcat to reproduce this bug at github:
https://github.com/jgaedicke/ShallowEtagHeaderFilter-bug-demo.
Affects: 4.2.2, 4.2.3
Reference URL: https://github.com/jgaedicke/ShallowEtagHeaderFilter-bug-demo
Issue Links:
- Provide controller method level alternative to WebContentInterceptor [SPR-8550] #13194 Provide controller method level alternative to WebContentInterceptor
Referenced from: commits 9d9433a