From 5672c4a3d58d362fef2593727661391a8f7beeaa Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Mon, 26 Aug 2024 13:48:58 +0200 Subject: [PATCH] Fix static file served with wrong MIME type --- src/middleware/staticFileServingAndDirectoryListings.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/middleware/staticFileServingAndDirectoryListings.js b/src/middleware/staticFileServingAndDirectoryListings.js index d1f3399..e055df5 100644 --- a/src/middleware/staticFileServingAndDirectoryListings.js +++ b/src/middleware/staticFileServingAndDirectoryListings.js @@ -76,6 +76,7 @@ module.exports = (req, res, logFacilities, config, next) => { let origHref = req.originalParsedURL.pathname; let ext = href.match(/[^\/]\.([^.]+)$/); if (!ext) ext = ""; + else ext = ext[1].toLowerCase(); let dHref = ""; try { dHref = decodeURIComponent(href);