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.
2 parents 45bf1a6 + 8871504 commit 6d7b5feCopy full SHA for 6d7b5fe
cohttp/src/transfer_io.ml
@@ -80,9 +80,14 @@ module Make(IO : S.IO) = struct
80
81
let write oc buf =
82
let len = String.length buf in
83
- write oc (Printf.sprintf "%x\r\n" len) >>= fun () ->
84
- write oc buf >>= fun () ->
85
- write oc "\r\n"
+ (* do NOT send empty chunks, as it signals the end of the
+ chunked body *)
+ if len <> 0 then
86
+ write oc (Printf.sprintf "%x\r\n" len) >>= fun () ->
87
+ write oc buf >>= fun () ->
88
+ write oc "\r\n"
89
+ else
90
+ return ()
91
end
92
93
module Fixed = struct
0 commit comments