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
@@ -123,48 +123,50 @@ static void querystring_cb(const char *name, const char *value) | |||
123 | ctx.repo = cgit_get_repoinfo(value); | 123 | ctx.repo = cgit_get_repoinfo(value); |
124 | } else if (!strcmp(name, "p")) { | 124 | } else if (!strcmp(name, "p")) { |
125 | ctx.qry.page = xstrdup(value); | 125 | ctx.qry.page = xstrdup(value); |
126 | } else if (!strcmp(name, "url")) { | 126 | } else if (!strcmp(name, "url")) { |
127 | cgit_parse_url(value); | 127 | cgit_parse_url(value); |
128 | } else if (!strcmp(name, "qt")) { | 128 | } else if (!strcmp(name, "qt")) { |
129 | ctx.qry.grep = xstrdup(value); | 129 | ctx.qry.grep = xstrdup(value); |
130 | } else if (!strcmp(name, "q")) { | 130 | } else if (!strcmp(name, "q")) { |
131 | ctx.qry.search = xstrdup(value); | 131 | ctx.qry.search = xstrdup(value); |
132 | } else if (!strcmp(name, "h")) { | 132 | } else if (!strcmp(name, "h")) { |
133 | ctx.qry.head = xstrdup(value); | 133 | ctx.qry.head = xstrdup(value); |
134 | ctx.qry.has_symref = 1; | 134 | ctx.qry.has_symref = 1; |
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; |
159 | ctx->cfg.cache_root = CGIT_CACHE_ROOT; | 161 | ctx->cfg.cache_root = CGIT_CACHE_ROOT; |
160 | ctx->cfg.cache_root_ttl = 5; | 162 | ctx->cfg.cache_root_ttl = 5; |
161 | ctx->cfg.cache_static_ttl = -1; | 163 | ctx->cfg.cache_static_ttl = -1; |
162 | ctx->cfg.css = "/cgit.css"; | 164 | ctx->cfg.css = "/cgit.css"; |
163 | ctx->cfg.logo = "/git-logo.png"; | 165 | ctx->cfg.logo = "/git-logo.png"; |
164 | ctx->cfg.max_repo_count = 50; | 166 | ctx->cfg.max_repo_count = 50; |
165 | ctx->cfg.max_commit_count = 50; | 167 | ctx->cfg.max_commit_count = 50; |
166 | ctx->cfg.max_lock_attempts = 5; | 168 | ctx->cfg.max_lock_attempts = 5; |
167 | ctx->cfg.max_msg_len = 60; | 169 | ctx->cfg.max_msg_len = 60; |
168 | ctx->cfg.max_repodesc_len = 60; | 170 | ctx->cfg.max_repodesc_len = 60; |
169 | ctx->cfg.module_link = "./?repo=%s&page=commit&id=%s"; | 171 | ctx->cfg.module_link = "./?repo=%s&page=commit&id=%s"; |
170 | ctx->cfg.renamelimit = -1; | 172 | ctx->cfg.renamelimit = -1; |