url: detect hostname more reliably in url.parse() · nodejs/node@08c2512 · GitHub
Skip to content

Commit 08c2512

Browse files
Trottdanielleadams
authored andcommitted
url: detect hostname more reliably in url.parse()
Based on existing tests and code comments, url.parse() is expected to treat any URL containing user@host as having a hostname. However, it turns out this behavior relies on the URL having a hash which is surprising, to put it mildly. Detect the host even without the hash. PR-URL: #41031 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Myles Borins <myles.borins@gmail.com>
1 parent b9567d9 commit 08c2512

2 files changed

Lines changed: 36 additions & 2 deletions

File tree

lib/url.js

Lines changed: 5 additions & 1 deletion

test/parallel/test-url-parse-format.js

Lines changed: 31 additions & 1 deletion

0 commit comments

Comments
 (0)