Skip to content

Commit 5932296

Browse files
shadeopsandrewrk
authored andcommitted
Fix the http.Server test and add it to the set of tests in http.zig
1 parent 7f3fdd2 commit 5932296

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/std/http.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,5 +274,6 @@ const std = @import("std.zig");
274274
test {
275275
_ = Client;
276276
_ = Method;
277+
_ = Server;
277278
_ = Status;
278279
}

lib/std/http/Server.zig

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -735,9 +735,12 @@ test "HTTP server handles a chunked transfer coding request" {
735735

736736
const server_thread = try std.Thread.spawn(.{}, (struct {
737737
fn apply(s: *std.http.Server) !void {
738-
const res = try s.accept(.{ .dynamic = max_header_size });
738+
var res = try s.accept(.{
739+
.allocator = allocator,
740+
.header_strategy = .{ .dynamic = max_header_size },
741+
});
739742
defer res.deinit();
740-
defer res.reset();
743+
defer _ = res.reset();
741744
try res.wait();
742745

743746
try expect(res.request.transfer_encoding.? == .chunked);

0 commit comments

Comments
 (0)