summaryrefslogtreecommitdiffabout
authorLars Hjemli <hjemli@gmail.com>2009-06-07 18:43:08 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2009-06-07 18:43:08 (UTC)
commite429fb0cca1e8c78da0ec38fe578bafdeec65534 (patch) (unidiff)
tree58c172f939509879045192fb8f1ba1d79160e67f
parent45e7fcecc1117440e6274ce3c6ab7d893c4986ee (diff)
downloadcgit-e429fb0cca1e8c78da0ec38fe578bafdeec65534.zip
cgit-e429fb0cca1e8c78da0ec38fe578bafdeec65534.tar.gz
cgit-e429fb0cca1e8c78da0ec38fe578bafdeec65534.tar.bz2
Return http statuscode 404 on unknown branch
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.c2
-rw-r--r--cgit.h2
-rw-r--r--ui-shared.c2
3 files changed, 6 insertions, 0 deletions
diff --git a/cgit.c b/cgit.c
index 64d95f9..19adadd 100644
--- a/cgit.c
+++ b/cgit.c
@@ -287,2 +287,4 @@ static int prepare_repo_cmd(struct cgit_context *ctx)
287 ctx->qry.head = ctx->repo->defbranch; 287 ctx->qry.head = ctx->repo->defbranch;
288 ctx->page.status = 404;
289 ctx->page.statusmsg = "not found";
288 cgit_print_http_headers(ctx); 290 cgit_print_http_headers(ctx);
diff --git a/cgit.h b/cgit.h
index 5f7af51..00aca4c 100644
--- a/cgit.h
+++ b/cgit.h
@@ -183,2 +183,4 @@ struct cgit_page {
183 char *title; 183 char *title;
184 int status;
185 char *statusmsg;
184}; 186};
diff --git a/ui-shared.c b/ui-shared.c
index de77bbf..2630f23 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -458,2 +458,4 @@ void cgit_print_http_headers(struct cgit_context *ctx)
458{ 458{
459 if (ctx->page.status)
460 htmlf("Status: %d %s\n", ctx->page.status, ctx->page.statusmsg);
459 if (ctx->page.mimetype && ctx->page.charset) 461 if (ctx->page.mimetype && ctx->page.charset)