Return http statuscode 404 on unknown branch

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
这个提交包含在:
Lars Hjemli
2009-06-07 20:43:08 +02:00
父节点 45e7fcecc1
当前提交 e429fb0cca
共有 3 个文件被更改,包括 6 次插入0 次删除

2
cgit.c
查看文件

@@ -285,6 +285,8 @@ static int prepare_repo_cmd(struct cgit_context *ctx)
if (get_sha1(ctx->qry.head, sha1)) {
tmp = xstrdup(ctx->qry.head);
ctx->qry.head = ctx->repo->defbranch;
ctx->page.status = 404;
ctx->page.statusmsg = "not found";
cgit_print_http_headers(ctx);
cgit_print_docstart(ctx);
cgit_print_pageheader(ctx);