diff options
Diffstat (limited to 'lib/internal/url.js')
-rw-r--r-- | lib/internal/url.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/internal/url.js b/lib/internal/url.js index cff94e6b7d..d9daef1524 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js @@ -400,7 +400,9 @@ Object.defineProperties(URL.prototype, { ret += '@'; } ret += options.unicode ? - domainToUnicode(this.host) : this.host; + domainToUnicode(this.hostname) : this.hostname; + if (ctx.port !== null) + ret += `:${ctx.port}`; } else if (ctx.scheme === 'file:') { ret += '//'; } |