X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/488a214a81a25c6397c56822ed1713f51dddc520..97b3d252629a8a3b9d356c2532dec7611438e4b9:/ui-plain.c diff --git a/ui-plain.c b/ui-plain.c index f73cd14..93a3a05 100644 --- a/ui-plain.c +++ b/ui-plain.c @@ -31,7 +31,10 @@ static void print_object(const unsigned char *sha1, const char *path) html_status(404, "Not found", 0); return; } - ctx.page.mimetype = "text/plain"; + if (buffer_is_binary(buf, size)) + ctx.page.mimetype = "application/octet-stream"; + else + ctx.page.mimetype = "text/plain"; ctx.page.filename = fmt("%s", path); ctx.page.size = size; ctx.page.etag = sha1_to_hex(sha1);