mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
fix cache header with 0 age
This commit is contained in:
@@ -46,7 +46,7 @@ router.get('/:configuration/:resource/:type/:id/:extra?.json', (req, res, next)
|
|||||||
staleError: 'stale-if-error'
|
staleError: 'stale-if-error'
|
||||||
};
|
};
|
||||||
const cacheControl = Object.keys(cacheHeaders)
|
const cacheControl = Object.keys(cacheHeaders)
|
||||||
.map(prop => resp[prop] && cacheHeaders[prop] + '=' + resp[prop])
|
.map(prop => Number.isInteger(resp[prop]) && cacheHeaders[prop] + '=' + resp[prop])
|
||||||
.filter(val => !!val).join(', ');
|
.filter(val => !!val).join(', ');
|
||||||
|
|
||||||
res.setHeader('Cache-Control', `${cacheControl}, public`);
|
res.setHeader('Cache-Control', `${cacheControl}, public`);
|
||||||
|
|||||||
Reference in New Issue
Block a user