[
https://issues.apache.org/jira/browse/WICKET-2917?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jeremy Thomerson resolved WICKET-2917.
--------------------------------------
Fix Version/s: 1.4.10
1.5-M1
Resolution: Fixed
> WebResponse sets a negative Content-Length when length >2G
> ----------------------------------------------------------
>
> Key: WICKET-2917
> URL: https://issues.apache.org/jira/browse/WICKET-2917
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.4.5, 1.4.9
> Reporter: Louis Letourneau
> Assignee: Jeremy Thomerson
> Priority: Minor
> Fix For: 1.4.10, 1.5-M1
>
> Attachments: webResponse-contentLength-1.4.9.patch
>
>
> 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.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.