zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 47a2f2ddae9cc47ff6df7a71060bbb3f5f20f2e8 (tree)
parent 306176046e6ae5e30bc58e5f3bcf786159e367f2
Author: John Benediktsson <mrjbq7@gmail.com>
Date:   Fri, 22 Aug 2025 12:35:18 -0700

Merge pull request #24926 from mrjbq7/http-fetch

http.Client: don't forget to flush
Diffstat:
Mlib/std/http/Client.zig | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/std/http/Client.zig b/lib/std/http/Client.zig @@ -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(); }