2014-12-23 22:06 GMT+03:00 Christopher Schultz
>
> Konstantin,
>
> On 12/23/14 11:12 AM, Konstantin Kolinko wrote:
>>
>> 2) I think that if getHeaders().get(header) returns a single
>> element, it would be better to use setHeader() method instead of
>> addHeader() one.
>>
>> It is odd to call addHeader() for headers that are allowed to have
>> only one value.
>>
>> Using that method for "Content-Length" header though works
>> correctly. Internally both addHeader("Content-Length") and
>> setHeader("Content-Length") are mapped to
>> response.setContentLength() method. Duplicate attempts to set
>> Content-Length header overwrite the old value regardless of what
>> method was called.
>
> I hope they aren't mapped to HttpServletResponse.setContentLength,
> since that method can't handle values over 2^31.

There are internal methods that handle long values (up to 2^63) that
predate ServletResponse.setContentLengthLong() of Servlet 3.0.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to