Remove quotes from max-age in cache-control

This commit is contained in:
rijkvanzanten
2020-12-17 18:57:33 -05:00
parent 5024493f69
commit d08c91389a
3 changed files with 3 additions and 3 deletions

View File

@@ -19,7 +19,7 @@ const checkCacheMiddleware: RequestHandler = asyncHandler(async (req, res, next)
// Set cache-control header
if (env.CACHE_AUTO_PURGE !== true) {
const expiresAt = await cache.get(`${key}__expires_at`);
const maxAge = `max-age="${expiresAt - Date.now()}"`;
const maxAge = `max-age=${expiresAt - Date.now()}`;
const access = !!req.accountability?.role === false ? 'public' : 'private';
res.setHeader('Cache-Control', `${access}, ${maxAge}`);
}