Prevent source code viewing by "JSGI-BIN" instead of "jsgi-bin" in Windows
This commit is contained in:
parent
00073379d4
commit
534edc1eb8
2 changed files with 2 additions and 12 deletions
12
index.js
12
index.js
|
@ -188,7 +188,7 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e
|
|||
executeJSGI("." + a, req, res, dh, jsgiRequestObject);
|
||||
}
|
||||
|
||||
if (href.indexOf("/jsgi-bin") == 0) {
|
||||
if (href.match(new RegExp("/jsgi-bin(?:$|[?#/])",os.platform() == "win32" ? "i" : ""))) {
|
||||
fs.stat("." + href, function (err, stats) {
|
||||
if (!err) {
|
||||
if (!stats.isFile()) {
|
||||
|
@ -345,16 +345,6 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e
|
|||
}
|
||||
}
|
||||
});
|
||||
} else if (href == "/YellowSquare-interpreters.json" && path.normalize(__dirname + "/../../..") == process.cwd()) {
|
||||
if (!callServerError) {
|
||||
res.writeHead(200, "OK", {
|
||||
"Content-Type": "application/json",
|
||||
"Server": "YellowSquare/" + version
|
||||
});
|
||||
res.end(JSON.stringify(exttointerpreteruser, null, 2));
|
||||
} else {
|
||||
callServerError(200, "YellowSquare/" + version, exttointerpreteruser);
|
||||
}
|
||||
} else {
|
||||
elseCallback();
|
||||
}
|
||||
|
|
2
mod.info
2
mod.info
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"name": "DorianTech YellowSquare JSGI engine for SVR.JS",
|
||||
"version": "1.0.0"
|
||||
"version": "1.0.1"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue