From 68bc240cb967da50b79316382b637827a2b2ff3f Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Fri, 30 Oct 2026 10:33:30 -0700 Subject: Pick a blob's mimetype the way the plain page does --- source/ui-blob.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'source') diff --git a/source/ui-blob.c b/source/ui-blob.c index 0c90c42..948b348 100644 --- a/source/ui-blob.c +++ b/source/ui-blob.c @@ -210,10 +210,7 @@ void cgit_print_blob(const char *hex, char *path, const char *head, int file_onl return; } - if (buffer_is_binary(buf, size)) - ctx.page.mimetype = "application/octet-stream"; - else - ctx.page.mimetype = "text/plain"; + ctx.page.mimetype = buffer_is_binary(buf, size) ? "application/octet-stream" : "text/plain"; ctx.page.filename = path; ctx.page.untrusted = 1; cgit_print_http_headers(); -- cgit 2.12.1