diff --git a/src/serve_font.js b/src/serve_font.js index d8ac041e6..f80c4209c 100644 --- a/src/serve_font.js +++ b/src/serve_font.js @@ -58,9 +58,9 @@ export async function serve_font(options, allowedFonts, programOpts) { const modifiedSince = req.get('if-modified-since'); const cc = req.get('cache-control'); if (modifiedSince && (!cc || cc.indexOf('no-cache') === -1)) { - const lastDate = new Date(lastModified).getTime(); - const modDate = new Date(modifiedSince).getTime(); - if (lastDate === modDate) { + if ( + new Date(lastModified).getTime() === new Date(modifiedSince).getTime() + ) { return res.sendStatus(304); } } diff --git a/src/serve_rendered.js b/src/serve_rendered.js index ef5cf306e..f54cc4977 100644 --- a/src/serve_rendered.js +++ b/src/serve_rendered.js @@ -665,9 +665,10 @@ async function handleTileRequest( const modifiedSince = req.get('if-modified-since'); const cc = req.get('cache-control'); if (modifiedSince && (!cc || cc.indexOf('no-cache') === -1)) { - const lastDate = new Date(item.lastModified).getTime(); - const modDate = new Date(modifiedSince).getTime(); - if (lastDate === modDate) { + if ( + new Date(item.lastModified).getTime() === + new Date(modifiedSince).getTime() + ) { return res.sendStatus(304); } } diff --git a/src/serve_style.js b/src/serve_style.js index b6ff0e236..68c631928 100644 --- a/src/serve_style.js +++ b/src/serve_style.js @@ -143,9 +143,10 @@ export const serve_style = { const modifiedSince = req.get('if-modified-since'); const cc = req.get('cache-control'); if (modifiedSince && (!cc || cc.indexOf('no-cache') === -1)) { - const lastDate = new Date(item.lastModified).getTime(); - const modDate = new Date(modifiedSince).getTime(); - if (lastDate === modDate) { + if ( + new Date(item.lastModified).getTime() === + new Date(modifiedSince).getTime() + ) { return res.sendStatus(304); } }