amppackager
amppackager copied to clipboard
Generate conditional ETag from inner conditional response headers
Copy ETag and Last-Modified from the fetchResp to the outer resp. This enables clients to transparently take advantage of #34 without having to understand the SXG format.
On second thought, clients should probably not transparently handle conditional headers for SXGs. As implemented now, the packager will happily tell them to keep using an expired SXG as long as its inner payload hasn't changed.
To do this properly, the packager should probably generate an ETag which is a synthesis of the inner conditional response headers, the cert-sha256, and the sig expires. Then, when receiving an If-Not-Match, it should extract the cert-sha256 and sig expires from the given etag to see if they're still valid.