diff --git a/lib/url.js b/lib/url.js index 8314a82427dc04..a53f93ec2de04b 100644 --- a/lib/url.js +++ b/lib/url.js @@ -755,14 +755,14 @@ Url.prototype.resolveObject = function resolveObject(relative) { var removeAllDots = mustEndAbs; var srcPath = result.pathname && result.pathname.split('/') || []; var relPath = relative.pathname && relative.pathname.split('/') || []; - var psychotic = result.protocol && !slashedProtocol[result.protocol]; + var noLeadingSlashes = result.protocol && !slashedProtocol[result.protocol]; // if the url is a non-slashed url, then relative // links like ../.. should be able // to crawl up to the hostname, as well. This is strange. // result.protocol has already been set by now. // Later on, put the first path part into the host field. - if (psychotic) { + if (noLeadingSlashes) { result.hostname = ''; result.port = null; if (result.host) { @@ -810,7 +810,7 @@ Url.prototype.resolveObject = function resolveObject(relative) { // just pull out the search. // like href='?foo'. // Put this after the other two cases because it simplifies the booleans - if (psychotic) { + if (noLeadingSlashes) { result.hostname = result.host = srcPath.shift(); //occasionally the auth can get stuck only in host //this especially happens in cases like @@ -891,7 +891,7 @@ Url.prototype.resolveObject = function resolveObject(relative) { (srcPath[0] && srcPath[0].charAt(0) === '/'); // put the host back - if (psychotic) { + if (noLeadingSlashes) { result.hostname = result.host = isAbsolute ? '' : srcPath.length ? srcPath.shift() : ''; //occasionally the auth can get stuck only in host