diff options
Diffstat (limited to 'src/routes/api/image')
| -rw-r--r-- | src/routes/api/image/load.zig | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/routes/api/image/load.zig b/src/routes/api/image/load.zig index 1b2a3e2..3ef25d6 100644 --- a/src/routes/api/image/load.zig +++ b/src/routes/api/image/load.zig @@ -3,11 +3,13 @@ const std = @import("std"); const memora = @import("memora"); const Context = memora.Context; const Storage = memora.Storage; +const mime = @import("../../../mime.zig"); pub const access = .users; pub fn get(ctx: *Context) !memora.Stream { const id = ctx.request.head.target["/api/image/load/".len..]; var image = Storage.Image { .id = id, .timestamp = null }; + ctx.response.headers.content_type = comptime mime.content_types.get(".jpeg") orelse unreachable; return .from_file(try image.file(ctx.storage)); } |