forked from svrjs/svrjs
Rename properDirectoryListingServe function to properDirectoryListingAndStaticFileServe.
This commit is contained in:
parent
75e987dcf4
commit
c8c069aceb
2 changed files with 7 additions and 7 deletions
|
@ -3,7 +3,7 @@
|
||||||
"port": 80,
|
"port": 80,
|
||||||
"pubport": 80,
|
"pubport": 80,
|
||||||
"page404": "404.html",
|
"page404": "404.html",
|
||||||
"timestamp": 1694539313104,
|
"timestamp": 1694540087592,
|
||||||
"blacklist": [],
|
"blacklist": [],
|
||||||
"nonStandardCodes": [],
|
"nonStandardCodes": [],
|
||||||
"enableCompression": true,
|
"enableCompression": true,
|
||||||
|
|
12
svr.js
12
svr.js
|
@ -3402,13 +3402,13 @@ if (!cluster.isPrimary) {
|
||||||
if (e || !s.isFile()) {
|
if (e || !s.isFile()) {
|
||||||
fs.stat((readFrom + "/index.xhtml").replace(/\/+/g, "/"), function (e, s) {
|
fs.stat((readFrom + "/index.xhtml").replace(/\/+/g, "/"), function (e, s) {
|
||||||
if (e || !s.isFile()) {
|
if (e || !s.isFile()) {
|
||||||
properDirectoryListingServe();
|
properDirectoryListingAndStaticFileServe();
|
||||||
} else {
|
} else {
|
||||||
stats = s;
|
stats = s;
|
||||||
pth = (pth + "/index.xhtml").replace(/\/+/g, "/");
|
pth = (pth + "/index.xhtml").replace(/\/+/g, "/");
|
||||||
ext = "xhtml";
|
ext = "xhtml";
|
||||||
readFrom = "./" + pth;
|
readFrom = "./" + pth;
|
||||||
properDirectoryListingServe();
|
properDirectoryListingAndStaticFileServe();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -3416,7 +3416,7 @@ if (!cluster.isPrimary) {
|
||||||
pth = (pth + "/index.htm").replace(/\/+/g, "/");
|
pth = (pth + "/index.htm").replace(/\/+/g, "/");
|
||||||
ext = "htm";
|
ext = "htm";
|
||||||
readFrom = "./" + pth;
|
readFrom = "./" + pth;
|
||||||
properDirectoryListingServe();
|
properDirectoryListingAndStaticFileServe();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -3424,14 +3424,14 @@ if (!cluster.isPrimary) {
|
||||||
pth = (pth + "/index.html").replace(/\/+/g, "/");
|
pth = (pth + "/index.html").replace(/\/+/g, "/");
|
||||||
ext = "html";
|
ext = "html";
|
||||||
readFrom = "./" + pth;
|
readFrom = "./" + pth;
|
||||||
properDirectoryListingServe();
|
properDirectoryListingAndStaticFileServe();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
properDirectoryListingServe();
|
properDirectoryListingAndStaticFileServe();
|
||||||
}
|
}
|
||||||
|
|
||||||
function properDirectoryListingServe() {
|
function properDirectoryListingAndStaticFileServe() {
|
||||||
if (stats.isDirectory()) {
|
if (stats.isDirectory()) {
|
||||||
// Check if directory listing is enabled in the configuration
|
// Check if directory listing is enabled in the configuration
|
||||||
if (checkForEnabledDirectoryListing(req.headers.host)) {
|
if (checkForEnabledDirectoryListing(req.headers.host)) {
|
||||||
|
|
Reference in a new issue