Skip to content

Commit dce3432

Browse files
committed
web: fix POST without body with libcurl 7.66.0+
1 parent 53ea0a6 commit dce3432

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

web.ml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,11 @@ module Http (IO : IO_TYPE) (Curl_IO : CURL with type 'a t = 'a IO.t) : HTTP with
252252
set_readfunction h f
253253
| None ->
254254
Option.may (set_httpheader h) headers;
255-
set_readfunction h (fun _ -> "") (* prevent reading from stdin with POST without body *)
255+
(* prevent reading from stdin with POST without body *)
256+
set_readfunction h (fun _ -> "");
257+
(* prevent libcurl 7.66.0+ from sending Transfer-Encoding: chunked for POST without body.
258+
See https://github.com/curl/curl/pull/4138. *)
259+
set_postfieldsize h 0
256260
end;
257261
begin match action with
258262
| `GET | `DELETE | `CUSTOM _ -> ()

0 commit comments

Comments
 (0)