-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Konstantin,
On 12/23/14 2:18 PM, Konstantin Kolinko wrote:
> 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.
That's fine, but addHeader("Content-Length", "big-long-number") ought
to never boil-down to use setContentLength(int).
addIntHeader and setHeader(String,int) are fine, since they are
already limited to Java-int.
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
iQIcBAEBCAAGBQJUmcROAAoJEBzwKT+lPKRYeHYP/AmN8TrLJ9mTiJ9uNbLC2KX0
M9+IfMcWrIwaZcjarrnLBpTNH51tpuT+Iub3nuUFyFjXnJBQ6Wte9H4mee4kBdOh
hLd6LtQQJ4UdGX3eCHj4B46RJRPOuDyGoXn0JD5vrZ02/+99XHOGQduHq75H/TU/
Cy21+qffjCWFdaMH597wzs3E077piUxZtINoEPt157b7+uIs6pppKQFMwFoozBPM
6Mpar1WS+6nlIcKMztdWy6NRJMVX3xJ/MACAEKzskP/ROQGccy0IBApLS1eaiXRO
3r0HtNBV2s3yHhcnXCSSYnTBxsktPP0NtP4ciTA9Aaxy7qgShpUV4WU8R2w35ceX
dr2kaYtEPxhyoyCuwTRLW0r2HAVQv0MxQdCjV9EwLKY+OzCoFSqzg8wCpjLcVQrO
YmgDvvFlSBnGbWq5s3AxgV6UlhrLIlrsNMAuVFCnZdqdiACiwAn0PNlp9yGxrAfu
NyNUwP9+H8IF//K8ivtg+DOvyAkT7dLLyxC2d8muj8g8fMnxhmdvoIgC8icM6ax9
nRuqQRby/phfTWMtN8P7dF+irRxmcbWef8yiEv3By98OtL8+IXjMroutO6i8/6CU
ta3fs1wMmWx7HBRTk2FRxftKl6rHc0kn3B681HhOmAb1HLZ7lOUePBp8I/rs92F0
RPAeWvVs/Pz2uw7QDEcR
=6Q2g
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]