aboutsummaryrefslogtreecommitdiffstats
path: root/cgit.c
diff options
context:
space:
mode:
Diffstat (limited to 'cgit.c')
-rw-r--r--cgit.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/cgit.c b/cgit.c
index b3a98c1..dbec196 100644
--- a/cgit.c
+++ b/cgit.c
@@ -17,6 +17,14 @@
17 17
18const char *cgit_version = CGIT_VERSION; 18const char *cgit_version = CGIT_VERSION;
19 19
20void add_mimetype(const char *name, const char *value)
21{
22 struct string_list_item *item;
23
24 item = string_list_insert(xstrdup(name), &ctx.cfg.mimetypes);
25 item->util = xstrdup(value);
26}
27
20struct cgit_filter *new_filter(const char *cmd, int extra_args) 28struct cgit_filter *new_filter(const char *cmd, int extra_args)
21{ 29{
22 struct cgit_filter *f; 30 struct cgit_filter *f;
@@ -66,6 +74,8 @@ void config_cb(const char *name, const char *value)
66 ctx.cfg.virtual_root = ""; 74 ctx.cfg.virtual_root = "";
67 } else if (!strcmp(name, "nocache")) 75 } else if (!strcmp(name, "nocache"))
68 ctx.cfg.nocache = atoi(value); 76 ctx.cfg.nocache = atoi(value);
77 else if (!strcmp(name, "noplainemail"))
78 ctx.cfg.noplainemail = atoi(value);
69 else if (!strcmp(name, "noheader")) 79 else if (!strcmp(name, "noheader"))
70 ctx.cfg.noheader = atoi(value); 80 ctx.cfg.noheader = atoi(value);
71 else if (!strcmp(name, "snapshots")) 81 else if (!strcmp(name, "snapshots"))
@@ -120,6 +130,8 @@ void config_cb(const char *name, const char *value)
120 ctx.cfg.clone_prefix = xstrdup(value); 130 ctx.cfg.clone_prefix = xstrdup(value);
121 else if (!strcmp(name, "local-time")) 131 else if (!strcmp(name, "local-time"))
122 ctx.cfg.local_time = atoi(value); 132 ctx.cfg.local_time = atoi(value);
133 else if (!prefixcmp(name, "mimetype."))
134 add_mimetype(name + 9, value);
123 else if (!strcmp(name, "repo.group")) 135 else if (!strcmp(name, "repo.group"))
124 ctx.cfg.repo_group = xstrdup(value); 136 ctx.cfg.repo_group = xstrdup(value);
125 else if (!strcmp(name, "repo.url")) 137 else if (!strcmp(name, "repo.url"))
@@ -236,6 +248,7 @@ static void prepare_context(struct cgit_context *ctx)
236 ctx->page.modified = time(NULL); 248 ctx->page.modified = time(NULL);
237 ctx->page.expires = ctx->page.modified; 249 ctx->page.expires = ctx->page.modified;
238 ctx->page.etag = NULL; 250 ctx->page.etag = NULL;
251 memset(&ctx->cfg.mimetypes, 0, sizeof(struct string_list));
239} 252}
240 253
241struct refmatch { 254struct refmatch {