all repos — cgit @ 42effc939090b2fbf1b2b76cd1d9c30fabcd230e

a hyperfast web frontend for git written in c

allow specification of directly linked blobs mimetypes

Signed-off-by: Michael Krelin <hacker@klever.net>
Michael Krelin hacker@klever.net
Tue, 24 Jun 2008 23:42:32 +0200
commit

42effc939090b2fbf1b2b76cd1d9c30fabcd230e

parent

01d2dce7e73e3f022d186de27dd5d15574144ca8

3 files changed, 4 insertions(+), 1 deletions(-)

jump to
M cgit.ccgit.c

@@ -144,6 +144,8 @@ } else if (!strcmp(name, "path")) {

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); } }
M cgit.hcgit.h

@@ -116,6 +116,7 @@ char *sha1;

char *sha2; char *path; char *name; + char *mimetype; int ofs; };
M ui-blob.cui-blob.c

@@ -65,7 +65,7 @@ return;

} buf[size] = '\0'; - ctx.page.mimetype = NULL; + ctx.page.mimetype = ctx.qry.mimetype; ctx.page.filename = path; cgit_print_http_headers(&ctx); write(htmlfd, buf, size);