We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4705278 commit 3cdec1cCopy full SHA for 3cdec1c
src/core/IO.ml
@@ -348,7 +348,14 @@ module Input = struct
348
method private refill (slice : Slice.t) : unit =
349
if !chunk_size = 0 && not !eof then (
350
chunk_size := read_next_chunk_len ();
351
- if !chunk_size = 0 then eof := true (* stream is finished *)
+ if !chunk_size = 0 then (
352
+ (* stream is finished, consume trailing \r\n *)
353
+ eof := true;
354
+ let line = read_line_using ~buf:line_buf ic in
355
+ if String.trim line <> "" then
356
+ raise
357
+ (fail (spf "expected \\r\\n to follow last chunk, got %S" line))
358
+ )
359
);
360
slice.off <- 0;
361
slice.len <- 0;
0 commit comments