fix: corregir formato de control de caché en la respuesta del servidor
This commit is contained in:
@@ -247,9 +247,10 @@ const sendResponse = async (
|
|||||||
): Promise<void> => {
|
): Promise<void> => {
|
||||||
const extension = path.extname(filePath).toLowerCase();
|
const extension = path.extname(filePath).toLowerCase();
|
||||||
const mimeType = MIME_TYPES[extension] || "application/octet-stream";
|
const mimeType = MIME_TYPES[extension] || "application/octet-stream";
|
||||||
const cacheControl = extension.match(/\.(?:html)$/)
|
const cacheControl = extension.match(/\.(?:html)$/)
|
||||||
? "no-cache"
|
? "no-cache"
|
||||||
: "public, max-age=86400, immutable";
|
: "public, max-age=86400, immutable";
|
||||||
|
|
||||||
|
|
||||||
const stat = await fs.stat(filePath).catch(() => undefined);
|
const stat = await fs.stat(filePath).catch(() => undefined);
|
||||||
const data = await fs.readFile(filePath);
|
const data = await fs.readFile(filePath);
|
||||||
|
|||||||
Reference in New Issue
Block a user