diff options
Diffstat (limited to 'ui-blob.c')
-rw-r--r-- | ui-blob.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -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); |