Add support for ETag in 'plain' view

When downloading a blob identified by its path, the client might want
to know if the blob has been modified since a previous download of the
same path. To this end, an ETag containing the blob SHA1 seems to be
ideal.

Todo: add support for HEAD requests...

Suggested-by: Owen Taylor <otaylor@redhat.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Tá an tiomantas seo le fáil i:
Lars Hjemli
2009-02-19 22:38:36 +01:00
tuismitheoir 6063e7b553
tiomantas 488a214a81
D'athraigh 4 comhad le 5 breiseanna agus 0 scriosta

Féach ar an gComhad

@ -468,6 +468,8 @@ void cgit_print_http_headers(struct cgit_context *ctx)
ctx->page.filename);
htmlf("Last-Modified: %s\n", http_date(ctx->page.modified));
htmlf("Expires: %s\n", http_date(ctx->page.expires));
if (ctx->page.etag)
htmlf("ETag: \"%s\"\n", ctx->page.etag);
html("\n");
}