author | Michael Krelin <hacker@klever.net> | 2008-06-24 21:42:32 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2008-06-24 21:42:32 (UTC) |
commit | 42effc939090b2fbf1b2b76cd1d9c30fabcd230e (patch) (unidiff) | |
tree | ba75a2bc400a2a1dab6417b33b97a0d020fabf0f /cgit.c | |
parent | 01d2dce7e73e3f022d186de27dd5d15574144ca8 (diff) | |
download | cgit-42effc939090b2fbf1b2b76cd1d9c30fabcd230e.zip cgit-42effc939090b2fbf1b2b76cd1d9c30fabcd230e.tar.gz cgit-42effc939090b2fbf1b2b76cd1d9c30fabcd230e.tar.bz2 |
allow specification of directly linked blobs mimetypes
Signed-off-by: Michael Krelin <hacker@klever.net>
-rw-r--r-- | cgit.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -135,24 +135,26 @@ static void querystring_cb(const char *name, const char *value) | |||
135 | } else if (!strcmp(name, "id")) { | 135 | } else if (!strcmp(name, "id")) { |
136 | ctx.qry.sha1 = xstrdup(value); | 136 | ctx.qry.sha1 = xstrdup(value); |
137 | ctx.qry.has_sha1 = 1; | 137 | ctx.qry.has_sha1 = 1; |
138 | } else if (!strcmp(name, "id2")) { | 138 | } else if (!strcmp(name, "id2")) { |
139 | ctx.qry.sha2 = xstrdup(value); | 139 | ctx.qry.sha2 = xstrdup(value); |
140 | ctx.qry.has_sha1 = 1; | 140 | ctx.qry.has_sha1 = 1; |
141 | } else if (!strcmp(name, "ofs")) { | 141 | } else if (!strcmp(name, "ofs")) { |
142 | ctx.qry.ofs = atoi(value); | 142 | ctx.qry.ofs = atoi(value); |
143 | } else if (!strcmp(name, "path")) { | 143 | } else if (!strcmp(name, "path")) { |
144 | ctx.qry.path = trim_end(value, '/'); | 144 | ctx.qry.path = trim_end(value, '/'); |
145 | } else if (!strcmp(name, "name")) { | 145 | } else if (!strcmp(name, "name")) { |
146 | ctx.qry.name = xstrdup(value); | 146 | ctx.qry.name = xstrdup(value); |
147 | } else if (!strcmp(name, "mimetype")) { | ||
148 | ctx.qry.mimetype = xstrdup(value); | ||
147 | } | 149 | } |
148 | } | 150 | } |
149 | 151 | ||
150 | static void prepare_context(struct cgit_context *ctx) | 152 | static void prepare_context(struct cgit_context *ctx) |
151 | { | 153 | { |
152 | memset(ctx, 0, sizeof(ctx)); | 154 | memset(ctx, 0, sizeof(ctx)); |
153 | ctx->cfg.agefile = "info/web/last-modified"; | 155 | ctx->cfg.agefile = "info/web/last-modified"; |
154 | ctx->cfg.nocache = 0; | 156 | ctx->cfg.nocache = 0; |
155 | ctx->cfg.cache_size = 0; | 157 | ctx->cfg.cache_size = 0; |
156 | ctx->cfg.cache_dynamic_ttl = 5; | 158 | ctx->cfg.cache_dynamic_ttl = 5; |
157 | ctx->cfg.cache_max_create_time = 5; | 159 | ctx->cfg.cache_max_create_time = 5; |
158 | ctx->cfg.cache_repo_ttl = 5; | 160 | ctx->cfg.cache_repo_ttl = 5; |