]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-blob.c
ui-blob: Do not accept mimetype from user
[ps-cgit] / ui-blob.c
index 70a671e6ca02b30e100f697994033aecac775ef7..2cce11cb976d7bc49f3ec5c776f57043cab76647 100644 (file)
--- a/ui-blob.c
+++ b/ui-blob.c
@@ -161,7 +161,6 @@ void cgit_print_blob(const char *hex, char *path, const char *head, int file_onl
        }
 
        buf[size] = '\0';
-       ctx.page.mimetype = ctx.qry.mimetype;
        if (!ctx.page.mimetype) {
                if (buffer_is_binary(buf, size))
                        ctx.page.mimetype = "application/octet-stream";
@@ -171,4 +170,5 @@ void cgit_print_blob(const char *hex, char *path, const char *head, int file_onl
        ctx.page.filename = path;
        cgit_print_http_headers();
        html_raw(buf, size);
+       free(buf);
 }