Be able to synchronize the TTL of cache-control header to expire in a coherent way

This commit is contained in:
Daniel García Aubert
2019-10-15 12:48:50 +02:00
parent f8e117a7b7
commit 5a7ffcf499
2 changed files with 44 additions and 5 deletions
+12 -2
View File
@@ -79,7 +79,12 @@ describe('cache-control header', function () {
return done(err);
}
assert.equal(res.headers['cache-control'], `public,max-age=${ttl}`);
const cacheControl = res.headers['cache-control'];
const [ type, maxAge ] = cacheControl.split(',');
const [ key, value ] = maxAge.split('=');
assert.ok(Number(value) <= ttl);
testClient.drain(done);
});
});
@@ -114,7 +119,12 @@ describe('cache-control header', function () {
return done(err);
}
assert.equal(res.headers['cache-control'], `public,max-age=${ttl}`);
const cacheControl = res.headers['cache-control'];
const [ type, maxAge ] = cacheControl.split(',');
const [ key, value ] = maxAge.split('=');
assert.ok(Number(value) <= ttl);
testClient.drain(done);
});
});