From 0642cae85bfcc17bcd01ab099b7499273c3a1cba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesin=CC=81ski?= Date: Thu, 23 Mar 2017 17:21:23 +0000 Subject: [PATCH] Shouldn't drop etag --- index.js | 3 +-- package.json | 2 +- test/updatetest.js | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 0b2fb98..e73fdf0 100644 --- a/index.js +++ b/index.js @@ -7,10 +7,9 @@ const understoodStatuses = [200, 203, 204, 300, 301, 302, 303, 307, 308, 404, 40 const hopByHopHeaders = {'connection':true, 'keep-alive':true, 'proxy-authenticate':true, 'proxy-authorization':true, 'te':true, 'trailer':true, 'transfer-encoding':true, 'upgrade':true}; const excludedFromRevalidationUpdate = { - 'etag': true, 'last-modified': true, // Per spec - 'content-range': true, // Since the old body is reused, it doesn't make sense to change properties of the body 'content-length': true, 'content-encoding': true, 'transfer-encoding': true, + 'content-range': true, }; function parseCacheControl(header) { diff --git a/package.json b/package.json index 5847b89..755fed9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "http-cache-semantics", - "version": "3.6.0", + "version": "3.6.1", "description": "Parses Cache-Control and other headers. Helps building correct HTTP caches and proxies", "main": "index.js", "repository": "https://github.com/pornel/http-cache-semantics.git", diff --git a/test/updatetest.js b/test/updatetest.js index 7abfa89..29a4628 100644 --- a/test/updatetest.js +++ b/test/updatetest.js @@ -40,6 +40,7 @@ function assertUpdates(firstRequest, firstResponse, secondRequest, secondRespons assert.equal(headers['foo'], 'updated'); assert.equal(headers['x-other'], 'original'); assert.strictEqual(headers['x-ignore-new'], undefined); + assert.strictEqual(headers['etag'], secondResponse.headers.etag); } describe('Update revalidated', function() {