Merge pull request #24926 from mrjbq7/http-fetch

http.Client: don't forget to flush
This commit is contained in:
John Benediktsson 2025-08-22 12:35:18 -07:00 committed by Alex Rønne Petersen
parent cf542500f8
commit 38ef3f8997
No known key found for this signature in database

View File

@ -1797,9 +1797,10 @@ pub fn fetch(client: *Client, options: FetchOptions) FetchError!FetchResult {
if (options.payload) |payload| {
req.transfer_encoding = .{ .content_length = payload.len };
var body = try req.sendBody(&.{});
var body = try req.sendBodyUnflushed(&.{});
try body.writer.writeAll(payload);
try body.end();
try req.connection.?.flush();
} else {
try req.sendBodiless();
}