diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2025-12-17 19:17:11 +0100 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2025-12-17 19:17:11 +0100 |
| commit | 99701b8d6fc0671fabc2e5d3ab7d6841bff9021a (patch) | |
| tree | 1e73fcf955b20451e50ada5a9889048148c15ed7 /src/routes | |
| parent | 03be4133908ca7e9af90a13bdaf9d3cde1430c9e (diff) | |
response with jpeg content_type on image/load
Diffstat (limited to 'src/routes')
| -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)); } |