]> granicus.if.org Git - cgit/commitdiff
ui-blob: Do not accept mimetype from user
authorJason A. Donenfeld <Jason@zx2c4.com>
Thu, 14 Jan 2016 13:31:13 +0000 (14:31 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Thu, 14 Jan 2016 13:31:13 +0000 (14:31 +0100)
cgit.c
cgit.h
ui-blob.c

diff --git a/cgit.c b/cgit.c
index 05e5d5737d71cc302868ffd4f6388e8d1f947e9d..3ed1935c1eb4eb5561ccaed3f9d169b72286ca90 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -314,8 +314,6 @@ static void querystring_cb(const char *name, const char *value)
                ctx.qry.path = trim_end(value, '/');
        } else if (!strcmp(name, "name")) {
                ctx.qry.name = xstrdup(value);
-       } else if (!strcmp(name, "mimetype")) {
-               ctx.qry.mimetype = xstrdup(value);
        } else if (!strcmp(name, "s")) {
                ctx.qry.sort = xstrdup(value);
        } else if (!strcmp(name, "showmsg")) {
diff --git a/cgit.h b/cgit.h
index b7eccdd2bd982198df2971060002f3d6f155c783..4b4bcf4b9cb30bda303ac9b597313be667e93274 100644 (file)
--- a/cgit.h
+++ b/cgit.h
@@ -173,7 +173,6 @@ struct cgit_query {
        char *sha2;
        char *path;
        char *name;
-       char *mimetype;
        char *url;
        char *period;
        int   ofs;
index 1ded8397f5d59d03cd8ecb17705c0c9f69e5e881..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";