From 40ed3c4d2493835cd0a9217b947b115780a9ff27 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 21 Feb 2024 20:51:18 -0700 Subject: [PATCH] std.http.Client: add keep_alive option to fetch --- lib/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 index 627245c4b1..b71548d634 100644 --- a/lib/std/http/Client.zig +++ b/lib/std/http/Client.zig @@ -462,7 +462,6 @@ pub const Response = struct { const first_line = it.next().?; if (first_line.len < 12) { - std.debug.print("first line: '{s}'\n", .{first_line}); return error.HttpHeadersInvalid; } @@ -1573,6 +1572,7 @@ pub const FetchOptions = struct { method: ?http.Method = null, payload: ?[]const u8 = null, raw_uri: bool = false, + keep_alive: bool = true, /// Standard headers that have default, but overridable, behavior. headers: Request.Headers = .{}, @@ -1622,6 +1622,7 @@ pub fn fetch(client: *Client, options: FetchOptions) !FetchResult { .headers = options.headers, .extra_headers = options.extra_headers, .privileged_headers = options.privileged_headers, + .keep_alive = options.keep_alive, }); defer req.deinit();