diff --git a/index.js b/index.js index bdcee08..4b47201 100644 --- a/index.js +++ b/index.js @@ -151,8 +151,8 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e headers: req.headers, input: inputStream, scriptName: a, - pathInfo: decodeURI(b), - pathTranslated: b ? decodeURI((process.cwd() + (require("os").platform == "win32" ? b.replace(/\//g, "\\") : b)).replace((require("os").platform == "win32" ? /\\\\/g : /\/\//g), (require("os").platform == "win32" ? "\\" : "/"))) : "", + pathInfo: decodeURIComponent(b), + pathTranslated: b ? ((process.cwd() + decodeURIComponent(require("os").platform == "win32" ? b.replace(/\//g, "\\") : b)).replace((require("os").platform == "win32" ? /\\\\/g : /\/\//g), (require("os").platform == "win32" ? "\\" : "/"))) : "", scheme: req.socket.encrypted ? "https" : "http", env: {}, jsgi: { @@ -200,14 +200,14 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e } if (href.match(new RegExp("/jsgi-bin(?:$|[?#/])",os.platform() == "win32" ? "i" : ""))) { - fs.stat("." + href, function (err, stats) { + fs.stat("." + decodeURIComponent(href), function (err, stats) { if (!err) { if (!stats.isFile()) { elseCallback(); } else { try { executeJSGIWithReqObj( - href, + decodeURIComponent(href), "", req, res, @@ -276,7 +276,7 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e } }); } - checkPath("." + href, function (pathp) { + checkPath("." + decodeURIComponent(href), function (pathp) { if (!pathp) { elseCallback(); } else {