diff --git a/index.js b/index.js index 5bf8232..264f77d 100644 --- a/index.js +++ b/index.js @@ -379,7 +379,7 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e executeCGI("." + a, req, res, dh, nEnv); } - var isCgiBin = href.match(new RegExp("/cgi-bin(?:$|[?#/])", os.platform() == "win32" ? "i" : "")); + var isCgiBin = href.match(new RegExp("^/cgi-bin(?:$|[?#/])", os.platform() == "win32" ? "i" : "")); var isScriptExt = scriptExts.indexOf("." + ext) != -1; if ((href == "/redbrick-interpreters.json" || href == "/redbrick-scriptexts.json" || (os.platform() == "win32" && (href.toLowerCase() == "/redbrick-interpreters.json" || href.toLowerCase() == "/redbrick-scriptexts.json"))) && path.normalize(__dirname + "/../../..") == process.cwd()) {