about summary refs log tree commit diff stats
path: root/ui-blob.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui-blob.c')
-rw-r--r--ui-blob.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/ui-blob.c b/ui-blob.c index 2cce11c..43a2f10 100644 --- a/ui-blob.c +++ b/ui-blob.c
@@ -161,12 +161,10 @@ void cgit_print_blob(const char *hex, char *path, const char *head, int file_onl
161 } 161 }
162 162
163 buf[size] = '\0'; 163 buf[size] = '\0';
164 if (!ctx.page.mimetype) { 164 if (buffer_is_binary(buf, size))
165 if (buffer_is_binary(buf, size)) 165 ctx.page.mimetype = "application/octet-stream";
166 ctx.page.mimetype = "application/octet-stream"; 166 else
167 else 167 ctx.page.mimetype = "text/plain";
168 ctx.page.mimetype = "text/plain";
169 }
170 ctx.page.filename = path; 168 ctx.page.filename = path;
171 cgit_print_http_headers(); 169 cgit_print_http_headers();
172 html_raw(buf, size); 170 html_raw(buf, size);