[ 
https://issues.apache.org/jira/browse/WICKET-2917?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Louis Letourneau updated WICKET-2917:
-------------------------------------

    Attachment: webResponse-contentLength-1.4.9.patch

Patch that adds the fix to WebResponse

> 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
>         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.

Reply via email to