summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-cache-semantics/test
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-cache-semantics/test')
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-cache-semantics/test/responsetest.js6
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-cache-semantics/test/revalidatetest.js15
2 files changed, 21 insertions, 0 deletions
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-cache-semantics/test/responsetest.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-cache-semantics/test/responsetest.js
index 27bdb28e04..763910b82c 100644
--- a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-cache-semantics/test/responsetest.js
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-cache-semantics/test/responsetest.js
@@ -34,6 +34,12 @@ describe('Response headers', function() {
assert.equal(cache.maxAge(), 678);
});
+ it('IIS', function() {
+ const cache = new CachePolicy(req, {headers:{'cache-control': 'private, public, max-age=259200'}}, {shared:false});
+ assert(!cache.stale());
+ assert.equal(cache.maxAge(), 259200);
+ });
+
it('pre-check tolerated', function() {
const cc = 'pre-check=0, post-check=0, no-store, no-cache, max-age=100';
const cache = new CachePolicy(req, {headers:{'cache-control': cc}});
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-cache-semantics/test/revalidatetest.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-cache-semantics/test/revalidatetest.js
index 1f905ec27c..9dc737718d 100644
--- a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-cache-semantics/test/revalidatetest.js
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-cache-semantics/test/revalidatetest.js
@@ -106,6 +106,7 @@ describe('Can be revalidated?', function() {
const headers = cache.revalidationHeaders(simpleRequest);
assertHeadersPassed(headers);
assert.equal(headers['if-modified-since'], 'Tue, 15 Nov 1994 12:45:26 GMT');
+ assert(!/113/.test(headers.warning));
});
it('not without validators', function() {
@@ -113,6 +114,20 @@ describe('Can be revalidated?', function() {
const headers = cache.revalidationHeaders(simpleRequest);
assertHeadersPassed(headers);
assertNoValidators(headers);
+ assert(!/113/.test(headers.warning));
+ })
+
+ it('113 added', function() {
+ const veryOldResponse = {
+ headers: {
+ age: 3600*72,
+ 'last-modified': 'Tue, 15 Nov 1994 12:45:26 GMT',
+ },
+ };
+
+ const cache = new CachePolicy(simpleRequest, veryOldResponse);
+ const headers = cache.responseHeaders(simpleRequest);
+ assert(/113/.test(headers.warning));
})
});