Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Curl no longer prepends the first HTTP request header to the output #1030

Merged
merged 1 commit into from
May 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Unreleased

- cohttp-curl: Curl no longer prepends the first HTTP request header to the output. (jonahbeckford #1030, #987)
- cohttp-eio: client: use permissive argument type for make_generic
- cohttp-eio: Improve error handling in example server (talex5 #1023)
- cohttp-eio: Don't blow up `Server.callback` on client disconnections. (mefyl #1015)
Expand Down
3 changes: 2 additions & 1 deletion cohttp-curl/src/cohttp_curl.ml
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ module Request = struct
let response_header_acc = ref [] in
let response_body = ref None in
let h = Curl.init () in
let buf = Buffer.create 128 in
Curl.setopt h (CURLOPT_URL uri);
Curl.setopt h (CURLOPT_CUSTOMREQUEST (Http.Method.to_string method_));
let () =
match headers with
| None -> ()
| Some headers ->
let buf = Buffer.create 128 in
let headers =
Http.Header.fold
(fun key value acc ->
Expand Down Expand Up @@ -120,6 +120,7 @@ module Request = struct
(match output with
| Discard -> fun s -> String.length s
| String ->
let buf = Buffer.create 128 in
response_body := Some buf;
fun s ->
Buffer.add_string buf s;
Expand Down
Loading