-rw-r--r-- | ui-shared.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ui-shared.c b/ui-shared.c index 29036d0..10be3c0 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -469,2 +469,4 @@ void cgit_print_http_headers(struct cgit_context *ctx) { + const char *method = getenv("REQUEST_METHOD"); + if (ctx->page.status) @@ -483,3 +485,7 @@ void cgit_print_http_headers(struct cgit_context *ctx) htmlf("Expires: %s\n", http_date(ctx->page.expires)); + if (ctx->page.etag) + htmlf("ETag: \"%s\"\n", ctx->page.etag); html("\n"); + if (method && !strcmp(method, "HEAD")) + exit(0); } |