]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-snapshot.c
snapshot: use cgit_print_error_page() instead of html_status()
[ps-cgit] / ui-snapshot.c
index ea77eb48c03f640891f7d56cdcbe027d8ba86a23..bf4bcd7b6fa9d90bbeadc6a6f548954bfe3134e2 100644 (file)
@@ -119,6 +119,7 @@ static int make_snapshot(const struct cgit_snapshot_format *format,
                cgit_print_error("Not a commit reference: %s", hex);
                return 1;
        }
+       ctx.page.etag = sha1_to_hex(sha1);
        ctx.page.mimetype = xstrdup(format->mimetype);
        ctx.page.filename = xstrdup(filename);
        cgit_print_http_headers();
@@ -212,7 +213,7 @@ void cgit_print_snapshot(const char *head, const char *hex,
        if (!hex && dwim) {
                hex = get_ref_from_filename(ctx.repo->url, filename, f);
                if (hex == NULL) {
-                       html_status(404, "Not found", 0);
+                       cgit_print_error_page(404, "Not found", "Not found");
                        return;
                }
                prefix = xstrdup(filename);