amppackager icon indicating copy to clipboard operation
amppackager copied to clipboard

Generate conditional ETag from inner conditional response headers

Open twifkak opened this issue 7 years ago • 1 comments
trafficstars

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.

twifkak avatar Sep 19 '18 08:09 twifkak

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.

twifkak avatar Sep 21 '18 23:09 twifkak