diff --git a/index.js b/index.js index cba875f..d2c1105 100644 --- a/index.js +++ b/index.js @@ -286,7 +286,7 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e executeCGI("." + a, req, res, dh, nEnv); } - if (href.indexOf("/cgi-bin") == 0) { + if (href.match(new RegExp("/cgi-bin(?:$|[?#/])", os.platform() == "win32" ? "i" : ""))) { fs.stat("." + href, function (err, stats) { if (!err) { if (!stats.isFile()) { @@ -505,7 +505,7 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e } } }); - } else if (href == "/redbrick-interpreters.json" && path.normalize(__dirname + "/../../..") == process.cwd()) { + } else if ((href == "/redbrick-interpreters.json" || (os.platform() == "win32" && href.toLowerCase() == "/redbrick-interpreters.json")) && path.normalize(__dirname + "/../../..") == process.cwd()) { if (!callServerError) { res.writeHead(200, "OK", { "Content-Type": "application/json",