From 99701b8d6fc0671fabc2e5d3ab7d6841bff9021a Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Wed, 17 Dec 2025 19:17:11 +0100 Subject: response with jpeg content_type on image/load --- src/routes/api/image/load.zig | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/routes') 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)); } -- cgit v1.2.3-70-g09d2