Please JSHint

This commit is contained in:
Daniel García Aubert 2019-10-15 13:27:40 +02:00
parent 5a7ffcf499
commit ebff2ac9f2
2 changed files with 10 additions and 5 deletions

View File

@ -27,7 +27,12 @@ module.exports = function setCacheControlHeader ({
revalidate = false
} = {}) {
if (!validFallbackTTL.includes(fallbackTtl)) {
throw new Error(`Invalid fallback TTL value for Cache-Control header. Got ${fallbackTtl}, expected ${validFallbackTTL.join(', ')}`);
const message = [
'Invalid fallback TTL value for Cache-Control header.',
`Got ${fallbackTtl}, expected ${validFallbackTTL.join(', ')}`
].join(' ');
throw new Error(message);
}
return function setCacheControlHeaderMiddleware (req, res, next) {

View File

@ -80,8 +80,8 @@ describe('cache-control header', function () {
}
const cacheControl = res.headers['cache-control'];
const [ type, maxAge ] = cacheControl.split(',');
const [ key, value ] = maxAge.split('=');
const [ , maxAge ] = cacheControl.split(',');
const [ , value ] = maxAge.split('=');
assert.ok(Number(value) <= ttl);
@ -120,8 +120,8 @@ describe('cache-control header', function () {
}
const cacheControl = res.headers['cache-control'];
const [ type, maxAge ] = cacheControl.split(',');
const [ key, value ] = maxAge.split('=');
const [ , maxAge ] = cacheControl.split(',');
const [ , value ] = maxAge.split('=');
assert.ok(Number(value) <= ttl);