The difficulty I see here is that the output is a byte stream, so watching a string pattern in this stream is not that easy.
An alternative is that instead of inserting the XSRF.js content before the "</body>" tag, we may simply append it to the end of the response. This means the script will be put outside the <html> tag, and thus does not conform to the HTML spec. However, mainstream browsers such as IE and FireFox usually tolerate this and can execute this script correctly... -Jack On Sat, Jul 18, 2009 at 3:34 PM, David Jencks <david_jen...@yahoo.com>wrote: > I happened to get an OOM exception when I tried to look at the web console > jmx viewer while the testsuite was running, coming from the regular > expression replace in XSRFHandler. Looking into this it collects the entire > output into a byte array and then processes it. I would think this does not > scale. > > Is it possible for this code to be rewritten to work with streams so not > very much output needs to be kept in memory at once? > > thanks > david jencks >