Fixed bug with URLs containing "jsgi-bin" that don't refer to "jsgi-bin" directory in the web root

This commit is contained in:
Dorian Niemiec 2024-02-15 20:09:10 +01:00
parent f019e845b7
commit 789fa15575

View file

@ -233,7 +233,7 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e
executeJSGI("." + a, req, res, dh, jsgiRequestObject);
}
if (href.match(new RegExp("/jsgi-bin(?:$|[?#/])",os.platform() == "win32" ? "i" : ""))) {
if (href.match(new RegExp("^/jsgi-bin(?:$|[?#/])",os.platform() == "win32" ? "i" : ""))) {
fs.stat("." + decodeURIComponent(href), function (err, stats) {
if (!err) {
if (!stats.isFile()) {