forked from svrjs/svrjs
Removed undocumented and non-working code.
This commit is contained in:
parent
e84bb426a7
commit
75e987dcf4
2 changed files with 23 additions and 27 deletions
|
@ -3,7 +3,7 @@
|
|||
"port": 80,
|
||||
"pubport": 80,
|
||||
"page404": "404.html",
|
||||
"timestamp": 1694539217054,
|
||||
"timestamp": 1694539313104,
|
||||
"blacklist": [],
|
||||
"nonStandardCodes": [],
|
||||
"enableCompression": true,
|
||||
|
|
48
svr.js
48
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 {
|
||||
|
|
Reference in a new issue