mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
Fix the http.Server test and add it to the set of tests in http.zig
This commit is contained in:
parent
7f3fdd2ff6
commit
59322963ce
2 changed files with 6 additions and 2 deletions
|
|
@ -274,5 +274,6 @@ const std = @import("std.zig");
|
||||||
test {
|
test {
|
||||||
_ = Client;
|
_ = Client;
|
||||||
_ = Method;
|
_ = Method;
|
||||||
|
_ = Server;
|
||||||
_ = Status;
|
_ = Status;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -735,9 +735,12 @@ test "HTTP server handles a chunked transfer coding request" {
|
||||||
|
|
||||||
const server_thread = try std.Thread.spawn(.{}, (struct {
|
const server_thread = try std.Thread.spawn(.{}, (struct {
|
||||||
fn apply(s: *std.http.Server) !void {
|
fn apply(s: *std.http.Server) !void {
|
||||||
const res = try s.accept(.{ .dynamic = max_header_size });
|
var res = try s.accept(.{
|
||||||
|
.allocator = allocator,
|
||||||
|
.header_strategy = .{ .dynamic = max_header_size },
|
||||||
|
});
|
||||||
defer res.deinit();
|
defer res.deinit();
|
||||||
defer res.reset();
|
defer _ = res.reset();
|
||||||
try res.wait();
|
try res.wait();
|
||||||
|
|
||||||
try expect(res.request.transfer_encoding.? == .chunked);
|
try expect(res.request.transfer_encoding.? == .chunked);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue