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

Claus Ibsen resolved CAMEL-25133.
---------------------------------
    Resolution: Fixed

Merged in https://github.com/apache/camel/pull/27397 (commit 18bf2dcb2b79) for 
4.23.0.

_Claude Code on behalf of davsclaus_

> camel-http-common - a non-chunked response over 2 GiB gets a wrong 
> Content-Length
> ---------------------------------------------------------------------------------
>
>                 Key: CAMEL-25133
>                 URL: https://issues.apache.org/jira/browse/CAMEL-25133
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-http-common
>            Reporter: Andrea Cosentino
>            Assignee: shashank
>            Priority: Minor
>             Fix For: 4.23.0
>
>
> DefaultHttpBinding.doWriteDirectResponse sizes a non-chunked response with
> {code}int len = copyStream(is, stream, response.getBufferSize());
> response.setContentLength(len);{code}
> IOHelper.copy returns an int. Above 2 GiB it used to wrap to a negative 
> value, and since CAMEL-25023 it is clamped to Integer.MAX_VALUE. Either way 
> the Content-Length header is wrong for such a response.
> Suggested fix: take the length as a long from the CachedOutputStream the body 
> was copied into, and call HttpServletResponse.setContentLengthLong (Servlet 
> 3.1+).
> Raised in the review of https://github.com/apache/camel/pull/26892 
> (CAMEL-25023).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to