diff options
| author | Jason A. Donenfeld | 2016-01-14 14:31:53 +0100 |
|---|---|---|
| committer | Jason A. Donenfeld | 2016-01-14 14:31:53 +0100 |
| commit | 92996ac2a6fc4e944c3d723e12d5ab244a43508e (patch) | |
| tree | ee7f420c6612fdc0dd64031631ed53b8ce626c2e | |
| parent | 1c581a072651524f3b0d91f33e22a42c4166dd96 (diff) | |
| download | cgit-92996ac2a6fc4e944c3d723e12d5ab244a43508e.tar.gz cgit-92996ac2a6fc4e944c3d723e12d5ab244a43508e.tar.bz2 cgit-92996ac2a6fc4e944c3d723e12d5ab244a43508e.zip | |
ui-blob: always use generic mimetypes
| -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); |
