Browse Source

Shouldn't drop etag

master
Kornel Lesiński 8 years ago
parent
commit
0642cae85b
  1. 3
      index.js
  2. 2
      package.json
  3. 1
      test/updatetest.js

3
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) {

2
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",

1
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() {

Loading…
Cancel
Save