Reset CURLOPT_CUSTOMREQUEST for each request

This commit is contained in:
Karl Seguin
2025-09-05 15:45:28 +08:00
parent 2522e7fe9c
commit 6600626f4f
2 changed files with 31 additions and 12 deletions

View File

@@ -345,10 +345,8 @@ fn makeRequest(self: *Client, handle: *Handle, transfer: *Transfer) !void {
try conn.setMethod(req.method);
if (req.body) |b| {
try conn.setBody(b);
} else if (req.method == .POST) {
// libcurl will crash if the method is POST but there's no body
// TODO: is there a setting for that..seems weird.
try conn.setBody("");
} else {
try errorCheck(c.curl_easy_setopt(easy, c.CURLOPT_HTTPGET, @as(c_long, 1)));
}
var header_list = req.headers;