Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
I've found that both these classes treats chunked streams without closing chunk as complete streams without any errors. This contradicts RFC2616 ยง3.6.1
Consider the following scenario:
1. HttpClient sends request to Server
2. Server accepts request and send response headers with Transfer-Encoding: chunked
3. Server sends first chunk completely and dies with segfault before sending the next chunk
4. HttpClient receives response headers and creates ChunkedInputStream
5. ChunkedInputStream reads this first chunk and encounters eof
Expected result:
IOException thrown indicating incomplete response
Actual result:
No exception is thrown, -1 is returned on the next read and nobody knows that response is incomplete.