summaryrefslogtreecommitdiffabout
path: root/cgit.c
Side-by-side diff
Diffstat (limited to 'cgit.c') (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/cgit.c b/cgit.c
index 2afc598..513ea12 100644
--- a/cgit.c
+++ b/cgit.c
@@ -210,2 +210,3 @@ static void prepare_context(struct cgit_context *ctx)
ctx->page.expires = ctx->page.modified;
+ ctx->page.etag = NULL;
}
@@ -289,2 +290,4 @@ static int prepare_repo_cmd(struct cgit_context *ctx)
ctx->qry.head = ctx->repo->defbranch;
+ ctx->page.status = 404;
+ ctx->page.statusmsg = "not found";
cgit_print_http_headers(ctx);
@@ -433,2 +436,3 @@ int main(int argc, const char **argv)
const char *cgit_config_env = getenv("CGIT_CONFIG");
+ const char *method = getenv("REQUEST_METHOD");
const char *path;
@@ -479,2 +483,4 @@ int main(int argc, const char **argv)
ctx.page.expires += ttl*60;
+ if (method && !strcmp(method, "HEAD"))
+ ctx.cfg.nocache = 1;
if (ctx.cfg.nocache)