Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
url: fix WHATWG formatting logic
  • Loading branch information
peakji authored May 3, 2018
commit 3db8aacfb1c49adfc36eb52a9503b4b60dc34ec6
4 changes: 2 additions & 2 deletions lib/internal/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ Object.defineProperties(URL.prototype, {
}, options);
const ctx = this[context];
var ret = ctx.scheme;
if (ctx.hostname !== null) {
if (ctx.host !== null) {
ret += '//';
const has_username = ctx.username !== '';
const has_password = ctx.password !== '';
Expand All @@ -401,7 +401,7 @@ Object.defineProperties(URL.prototype, {
}
ret += options.unicode ?
domainToUnicode(this.hostname) : this.hostname;
if (ctx.port !== '')
if (ctx.port !== null)
ret += `:${ctx.port}`;
} else if (ctx.scheme === 'file:') {
ret += '//';
Expand Down