List for cgit developers and users
 help / color / mirror / Atom feed
From: ysangkok at gmail.com (Janus Troelsen)
Subject: Fwd: [PATCH] Add Etags for snapshots
Date: Tue, 27 Jan 2015 22:14:54 +0100	[thread overview]
Message-ID: <CAKBpzhkBbEpraU=LCPFMU6hZwLNQ_w4Q=GK1nMH7K3ehF4NQwA@mail.gmail.com> (raw)
In-Reply-To: <CAKBpzhn6ZORwi5dDs2DcQ1qJgAsSe0o5-TqB-=c2_oYgSBT+mQ@mail.gmail.com>

Hi,

This adds etag support for snapshots. I tested it, it seems to work fine.

---
 ui-snapshot.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ui-snapshot.c b/ui-snapshot.c
index ea77eb4..cb34f4b 100644
--- a/ui-snapshot.c
+++ b/ui-snapshot.c
@@ -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();
--
2.1.0


       reply	other threads:[~2015-01-27 21:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAKBpzhn6ZORwi5dDs2DcQ1qJgAsSe0o5-TqB-=c2_oYgSBT+mQ@mail.gmail.com>
2015-01-27 21:14 ` ysangkok [this message]
2015-01-28 12:43   ` Jason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKBpzhkBbEpraU=LCPFMU6hZwLNQ_w4Q=GK1nMH7K3ehF4NQwA@mail.gmail.com' \
    --to=cgit@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).