fix(npdl): Add Last-Modified header on response

This allows Express to return `304 Not Modified` when the console
already has cached the requested BOSS file.
This commit is contained in:
Daniel López Guimaraes 2024-05-04 20:46:31 +01:00
parent c7fc1bbcdc
commit 5d2f11858e
No known key found for this signature in database
GPG Key ID: 6AC74DE3DEF050E0

View File

@ -36,6 +36,7 @@ npdl.get([
return;
}
response.setHeader('Last-Modified', new Date(Number(file.updated)).toUTCString());
readStream.pipe(response);
});
@ -43,4 +44,4 @@ const router = express.Router();
router.use(subdomain('npdl.cdn', npdl));
export default router;
export default router;