diff --git a/frameworks/Zig/zzz/README.md b/frameworks/Zig/zzz/README.md index b92aa3c9504..cf8c5c06ce2 100644 --- a/frameworks/Zig/zzz/README.md +++ b/frameworks/Zig/zzz/README.md @@ -1,5 +1,5 @@ -# [ZZZ](https://github.com/tardy-org/zzz) - Web Franework. +# [ZZZ](https://github.com/tardy-org/zzz) - Web Framework. ## Description diff --git a/frameworks/Zig/zzz/src/main.zig b/frameworks/Zig/zzz/src/main.zig index 3f4c1014cc8..a3d51bf4225 100644 --- a/frameworks/Zig/zzz/src/main.zig +++ b/frameworks/Zig/zzz/src/main.zig @@ -76,19 +76,23 @@ pub fn main() !void { } pub fn home_handler(ctx: *const Context, _: void) !Respond { - try ctx.response.headers.put("Date", try ctx.allocator.dupe(u8, date[0..])); return ctx.response.apply(.{ .mime = http.Mime.TEXT, .body = "Hello, World!", .status = .OK, + .headers = &.{ + .{"Date", try ctx.allocator.dupe(u8, date[0..])}, + }, }); } pub fn json_handler(ctx: *const Context, _: void) !Respond { - try ctx.response.headers.put("Date", try ctx.allocator.dupe(u8, date[0..])); return ctx.response.apply(.{ .mime = http.Mime.JSON, .body = try std.json.stringifyAlloc(ctx.allocator, Message{ .message = "Hello, World!" }, .{}), .status = .OK, + .headers = &.{ + .{"Date", try ctx.allocator.dupe(u8, date[0..])}, + }, }); }