You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Louis Letourneau (JIRA)" <ji...@apache.org> on 2010/06/15 20:41:25 UTC

[jira] Commented: (WICKET-2917) WebResponse sets a negative Content-Length when length >2G

    [ https://issues.apache.org/jira/browse/WICKET-2917?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12879064#action_12879064 ] 

Louis Letourneau commented on WICKET-2917:
------------------------------------------

The patch tests for the length, but it's not necessary I think, you could just use the addHeader all the time instead.

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