|
diff --git a/cgit.c b/cgit.c index 2afc598..513ea12 100644 --- a/ cgit.c+++ b/ cgit.c |
|
@@ -209,4 +209,5 @@ static void prepare_context(struct cgit_context *ctx) |
209 | ctx->page.modified = time(NULL); |
209 | ctx->page.modified = time(NULL); |
210 | ctx->page.expires = ctx->page.modified; |
210 | ctx->page.expires = ctx->page.modified; |
| |
211 | ctx->page.etag = NULL; |
211 | } |
212 | } |
212 | |
213 | |
@@ -288,4 +289,6 @@ static int prepare_repo_cmd(struct cgit_context *ctx) |
288 | tmp = xstrdup(ctx->qry.head); |
289 | tmp = xstrdup(ctx->qry.head); |
289 | ctx->qry.head = ctx->repo->defbranch; |
290 | ctx->qry.head = ctx->repo->defbranch; |
| |
291 | ctx->page.status = 404; |
| |
292 | ctx->page.statusmsg = "not found"; |
290 | cgit_print_http_headers(ctx); |
293 | cgit_print_http_headers(ctx); |
291 | cgit_print_docstart(ctx); |
294 | cgit_print_docstart(ctx); |
@@ -432,4 +435,5 @@ int main(int argc, const char **argv) |
432 | { |
435 | { |
433 | const char *cgit_config_env = getenv("CGIT_CONFIG"); |
436 | const char *cgit_config_env = getenv("CGIT_CONFIG"); |
| |
437 | const char *method = getenv("REQUEST_METHOD"); |
434 | const char *path; |
438 | const char *path; |
435 | char *qry; |
439 | char *qry; |
@@ -478,4 +482,6 @@ int main(int argc, const char **argv) |
478 | ttl = calc_ttl(); |
482 | ttl = calc_ttl(); |
479 | ctx.page.expires += ttl*60; |
483 | ctx.page.expires += ttl*60; |
| |
484 | if (method && !strcmp(method, "HEAD")) |
| |
485 | ctx.cfg.nocache = 1; |
480 | if (ctx.cfg.nocache) |
486 | if (ctx.cfg.nocache) |
481 | ctx.cfg.cache_size = 0; |
487 | ctx.cfg.cache_size = 0; |
|