]> git.cameronkatri.com Git - cgit.git/blobdiff - ui-plain.c
Merge branch 'plain-etag'
[cgit.git] / ui-plain.c
index f73cd14e8e56e3b080fe73a647c5ff91ed2f58ed..93a3a05ac50f7a43b3c50529a011f0c9fdbf547c 100644 (file)
@@ -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);