-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Description
Component: spring-security-web-5.1.3.RELEASE.jar (also with latest 5.1.6)
TL;DR: Filters relying on OnCommittedResponseWrapper do not work when a response length is announced with ServletResponse.setContentLengthLong before it is written.
Hey guys. I've noticed, that my HeaderWriters are not triggered for responses served by Tomcats 8.5's default servlet. I've found that the OnCommittedResponseWrapper.onResponseCommitted is never triggered. Debugging through the filter chain I've noticed that tomcats org.apache.catalina.servlets.DefaultServlet uses ServletResponse.setContentLengthLong (see https://github.com/apache/tomcat/blob/8.5.45/java/org/apache/catalina/servlets/DefaultServlet.java#L1063) instead of ServletResponse.setContentLength, which is not covered by OnCommittedResponseWrapper (see
Line 67 in f3cdd44
| public void setContentLength(int len) { |
Keep up the good work!