Make it work under Windows

This commit is contained in:
Dorian Niemiec 2023-08-26 14:53:08 +02:00
parent c3245f287a
commit 8edef21682

View file

@ -77,7 +77,6 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e
"Server": "RedBrick/" + version
});
res.end("<html><head></head><body><h1>RedBrick Error!</h1><p>Reason: " + err.message + "</p></body></html>");
} else {
callServerError(500, "RedBrick/" + version, err);
}
@ -110,7 +109,7 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e
res.end("<html><head></head><body><h1>RedBrick Error!</h1><p>Reason: " + ex.message + "</p></body></html>");
return;
}
args.push(fname);
args.push(__dirname + "/../../../temp/" + tempID);
filename = args.shift();
} else {
filename = (process.cwd() + (os.platform() == "win32" ? "\\" + fname.replace(/\//g, "\\") : "/" + fname)).replace(os.platform() == "win32" ? /\\+/ : /\/+/, os.platform() == "win32" ? "\\" : "/");