diff --git a/config.json b/config.json index ed9658d..51da81b 100644 --- a/config.json +++ b/config.json @@ -3,7 +3,7 @@ "port": 80, "pubport": 80, "page404": "404.html", - "timestamp": 1694539217054, + "timestamp": 1694539313104, "blacklist": [], "nonStandardCodes": [], "enableCompression": true, diff --git a/svr.js b/svr.js index 67922df..57861e0 100644 --- a/svr.js +++ b/svr.js @@ -3396,39 +3396,35 @@ if (!cluster.isPrimary) { // Check if index file exists if (req.url == "/" || stats.isDirectory()) { - fs.stat(readFrom + "/.notindex".replace(/\/+/g, "/"), function (e) { - if (e) { - fs.stat((readFrom + "/index.html").replace(/\/+/g, "/"), function (e, s) { + fs.stat((readFrom + "/index.html").replace(/\/+/g, "/"), function (e, s) { + if (e || !s.isFile()) { + fs.stat((readFrom + "/index.htm").replace(/\/+/g, "/"), function (e, s) { if (e || !s.isFile()) { - fs.stat((readFrom + "/index.htm").replace(/\/+/g, "/"), function (e, s) { - if (e || !s.isFile()) { - fs.stat((readFrom + "/index.xhtml").replace(/\/+/g, "/"), function (e, s) { - if (e || !s.isFile()) { - properDirectoryListingServe(); - } else { - stats = s; - pth = (pth + "/index.xhtml").replace(/\/+/g, "/"); - ext = "xhtml"; - readFrom = "./" + pth; - properDirectoryListingServe(); - } - }); - } else { - stats = s; - pth = (pth + "/index.htm").replace(/\/+/g, "/"); - ext = "htm"; - readFrom = "./" + pth; - properDirectoryListingServe(); - } - }); + fs.stat((readFrom + "/index.xhtml").replace(/\/+/g, "/"), function (e, s) { + if (e || !s.isFile()) { + properDirectoryListingServe(); + } else { + stats = s; + pth = (pth + "/index.xhtml").replace(/\/+/g, "/"); + ext = "xhtml"; + readFrom = "./" + pth; + properDirectoryListingServe(); + } + }); } else { stats = s; - pth = (pth + "/index.html").replace(/\/+/g, "/"); - ext = "html"; + pth = (pth + "/index.htm").replace(/\/+/g, "/"); + ext = "htm"; readFrom = "./" + pth; properDirectoryListingServe(); } }); + } else { + stats = s; + pth = (pth + "/index.html").replace(/\/+/g, "/"); + ext = "html"; + readFrom = "./" + pth; + properDirectoryListingServe(); } }); } else {