diff --git a/lib/http/base.js b/lib/http/base.js index 74f78407..a997263a 100644 --- a/lib/http/base.js +++ b/lib/http/base.js @@ -1181,7 +1181,7 @@ function Request(req, res, url) { this.headers = Object.create(null); this.contentType = 'bin'; this.url = '/'; - this.pathname = ''; + this.pathname = '/'; this.path = []; this.trailing = false; this.query = Object.create(null); @@ -1221,8 +1221,13 @@ Request.prototype.init = function init(req, res, url) { this.emit('end'); }); - if (url != null) - this.parse(url); + if (url != null) { + try { + this.parse(url); + } catch (e) { + ; + } + } }; Request.prototype.parse = function parse(url) { @@ -1245,6 +1250,7 @@ Request.prototype.parse = function parse(url) { } } + pathname = pathname.replace(/%2f/gi, ''); pathname = unescape(pathname); } else { pathname = '/';