diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-10-05 15:33:46 +0200 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-10-05 15:33:46 +0200 |
| commit | 02582cc490fc0d753dd153211cc172eb28fbee5d (patch) | |
| tree | 4add149d5e1ecf28cf20ecb497626fef85cdbd75 /src/http/handler/static.zig | |
| parent | 2f3199622d9e7a97da4b5c31a2d81b170b7cdaa6 (diff) | |
first sketch of wasm environment
Diffstat (limited to 'src/http/handler/static.zig')
| -rw-r--r-- | src/http/handler/static.zig | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/http/handler/static.zig b/src/http/handler/static.zig index d53f213..df307b7 100644 --- a/src/http/handler/static.zig +++ b/src/http/handler/static.zig @@ -2,10 +2,12 @@ const Interface = @import("Interface.zig"); const Context = @import("context.zig").Context; const Response = @import("../Response.zig"); -pub fn Static(route: anytype, content: []const u8) Context(route) { +pub fn Static(route: anytype, content: []const u8, mime: []const u8) Context(route) { const get = struct { fn get(_: Context(route).Request) Response { - return .ok(.string(content)); + return .withHeaders(.ok, .string(content), &.{ + .{ .name = "Content-Type", .value = mime }, + }); } }.get; |