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:
@ -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");
|
||||
}
|
||||
|
||||
|
Tagairt in Eagrán Nua
Cuir bac ar úsáideoir