diff --git a/lib/url.js b/lib/url.js index 0302fda1427..ac82d251179 100644 --- a/lib/url.js +++ b/lib/url.js @@ -318,6 +318,8 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { // need to be. for (var i = 0, l = autoEscape.length; i < l; i++) { var ae = autoEscape[i]; + if (rest.indexOf(ae) === -1) + continue; var esc = encodeURIComponent(ae); if (esc === ae) { esc = escape(ae);