all repos — cgit @ 92996ac2a6fc4e944c3d723e12d5ab244a43508e

a hyperfast web frontend for git written in c

ui-blob: always use generic mimetypes
Jason A. Donenfeld Jason@zx2c4.com
Thu, 14 Jan 2016 14:31:53 +0100
commit

92996ac2a6fc4e944c3d723e12d5ab244a43508e

parent

1c581a072651524f3b0d91f33e22a42c4166dd96

1 files changed, 4 insertions(+), 6 deletions(-)

jump to
M ui-blob.cui-blob.c

@@ -161,12 +161,10 @@ return;

} buf[size] = '\0'; - if (!ctx.page.mimetype) { - if (buffer_is_binary(buf, size)) - ctx.page.mimetype = "application/octet-stream"; - else - 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 = path; cgit_print_http_headers(); html_raw(buf, size);