Skip to content

Commit

Permalink
reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
acalcutt committed Jan 4, 2025
1 parent 23f50d0 commit f888286
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/serve_font.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/serve_rendered.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/serve_style.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit f888286

Please sign in to comment.