From 3484b918c162be76cbe0e560e30466eda3f9ff09 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Thu, 24 Sep 2026 20:37:17 -1000 Subject: Send a charset only with a text type Archives, packs and the HEAD file went out as octet-stream or gzip with a UTF-8 charset on the end, since only the plain and about pages cleared it. --- source/ui-plain.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'source/ui-plain.c') diff --git a/source/ui-plain.c b/source/ui-plain.c index 7db6e07..6d02051 100644 --- a/source/ui-plain.c +++ b/source/ui-plain.c @@ -81,14 +81,8 @@ static void print_object(const struct object_id *oid, const char *path) ctx.page.mimetype = NULL; } - if (!ctx.page.mimetype) { - if (buffer_is_binary(buf, size)) { - ctx.page.mimetype = "application/octet-stream"; - ctx.page.charset = NULL; - } else { - ctx.page.mimetype = "text/plain"; - } - } + if (!ctx.page.mimetype) + ctx.page.mimetype = buffer_is_binary(buf, size) ? "application/octet-stream" : "text/plain"; ctx.page.filename = path; ctx.page.size = size; cgit_print_http_headers(); -- cgit 2.12.1