Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Pick a blob's mimetype the way the plain page does
Diffstat (limited to '')
| -rw-r--r-- | source/ui-blob.c | 5 |
1 file changed, 1 insertion, 4 deletions
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(); |
