You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
I fixed this issue by not delegating the flushBuffer call to the actual response.
Indeed, multiple parts of Spring can commit the response, making it impossible for the filter to act on it.
In this particular case, Dec 22 has to be seen "on Dec 22 at the latest". We might pull it forward by a week or so. In any case, we'll keep the release target on JIRA up to date.
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:
Referenced from: commits 9d9433a
The text was updated successfully, but these errors were encountered: