diff --git a/lib/std/http/Client.zig b/lib/std/http/Client.zig index b8a4d7ee91..ed11a48e26 100644 --- a/lib/std/http/Client.zig +++ b/lib/std/http/Client.zig @@ -1666,7 +1666,7 @@ pub fn open( } pub const FetchOptions = struct { - server_header_buffer: ?[]u8 = null, + server_header_buffer: []u8, redirect_behavior: ?Request.RedirectBehavior = null, /// If the server sends a body, it will be appended to this ArrayList. @@ -1712,13 +1712,11 @@ pub fn fetch(client: *Client, options: FetchOptions) !Response { .url => |u| try Uri.parse(u), .uri => |u| u, }; - var server_header_buffer: [16 * 1024]u8 = undefined; - const method: http.Method = options.method orelse if (options.payload != null) .POST else .GET; var req = try open(client, method, uri, .{ - .server_header_buffer = options.server_header_buffer orelse &server_header_buffer, + .server_header_buffer = options.server_header_buffer, .redirect_behavior = options.redirect_behavior orelse if (options.payload == null) @enumFromInt(3) else .unhandled, .headers = options.headers,