Description
When using ResourceStreamRequestTarget + FileResourceStream to send a file <2G, the resulting Content-Length in the header is a large negative value. This is due to a cast between a long and an int.
In wicket, all methods dealing with content-length use longs, but the servlet api HttpServletResponse takes in an int, so WebResponse casts the long into an int which causes the problem.
The simple work around is to check for >2G lengths and use the addHeader method instead of setContentLength.
Attached is an extended WebResponse that fixes the problem. This should probably be applied to WebResponse.