From c8c069aceba10426c5e9259a5c7777656c8e5952 Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Tue, 12 Sep 2023 19:50:39 +0200 Subject: [PATCH] Rename properDirectoryListingServe function to properDirectoryListingAndStaticFileServe. --- config.json | 2 +- svr.js | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/config.json b/config.json index 51da81b..40f4266 100644 --- a/config.json +++ b/config.json @@ -3,7 +3,7 @@ "port": 80, "pubport": 80, "page404": "404.html", - "timestamp": 1694539313104, + "timestamp": 1694540087592, "blacklist": [], "nonStandardCodes": [], "enableCompression": true, diff --git a/svr.js b/svr.js index 57861e0..5f51a02 100644 --- a/svr.js +++ b/svr.js @@ -3402,13 +3402,13 @@ if (!cluster.isPrimary) { if (e || !s.isFile()) { fs.stat((readFrom + "/index.xhtml").replace(/\/+/g, "/"), function (e, s) { if (e || !s.isFile()) { - properDirectoryListingServe(); + properDirectoryListingAndStaticFileServe(); } else { stats = s; pth = (pth + "/index.xhtml").replace(/\/+/g, "/"); ext = "xhtml"; readFrom = "./" + pth; - properDirectoryListingServe(); + properDirectoryListingAndStaticFileServe(); } }); } else { @@ -3416,7 +3416,7 @@ if (!cluster.isPrimary) { pth = (pth + "/index.htm").replace(/\/+/g, "/"); ext = "htm"; readFrom = "./" + pth; - properDirectoryListingServe(); + properDirectoryListingAndStaticFileServe(); } }); } else { @@ -3424,14 +3424,14 @@ if (!cluster.isPrimary) { pth = (pth + "/index.html").replace(/\/+/g, "/"); ext = "html"; readFrom = "./" + pth; - properDirectoryListingServe(); + properDirectoryListingAndStaticFileServe(); } }); } else { - properDirectoryListingServe(); + properDirectoryListingAndStaticFileServe(); } - function properDirectoryListingServe() { + function properDirectoryListingAndStaticFileServe() { if (stats.isDirectory()) { // Check if directory listing is enabled in the configuration if (checkForEnabledDirectoryListing(req.headers.host)) {