I'm using tomcat 6.0.18. I added a filter that adds a custom response header by doing setIntHeader/addIntHeader, but it didnt work.
I debugged,looked at source and figured out that the place where its not working. Before adding headers, there is a check like this: public boolean isAppCommitted() { return (this.appCommitted || isCommitted() || isSuspended() || ((getContentLength() > 0) && (getContentCount() >= getContentLength()))); } Since contentCount [output buffer] and contentLength [Content-Length response header] are equal in my case, its not adding that header. When there is no content-length in response [ex: status code 304], my custom header is coming out nicely. Is there a way to not use fixed content lengths or should I add calculate and change content length while adding custom header? Thanks Anantha