diff --git a/lib/std/http/Server.zig b/lib/std/http/Server.zig index cab82b6fb194bbd1454e9a3475929fe0305fd5db..4f8866e532c9e3e224f6015aeee1ea1dbdcfb8e3 100644 --- a/lib/std/http/Server.zig +++ b/lib/std/http/Server.zig @@ -303,6 +303,15 @@ pub const Request = struct { request: *Request, content: []const u8, options: RespondOptions, + ) std.io.Writer.Error!void { + try respondUnflushed(request, content, options); + try request.server.out.flush(); + } + + pub fn respondUnflushed( + request: *Request, + content: []const u8, + options: RespondOptions, ) std.io.Writer.Error!void { assert(options.status != .@"continue"); if (std.debug.runtime_safety) {