Internal URL parser diverges from the spec in some parts #39798
Labels
whatwg-url
Issues and PRs related to the WHATWG URL implementation.
wontfix
Issues that will not be fixed.
Version
v14.16.0
Platform
Darwin Mac-Book-Pro.local 20.5.0 Darwin Kernel Version 20.5.0: Sat May 8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64 x86_64
Subsystem
url › node_url.cc
What steps will reproduce the bug?
It's not directly a bug I have encountered but while I was delving into Node's internal URL parser I have noticed that it diverges from the spec in some parts, specifically for
kHost
andkHostname
. Here's an excerpt from the spec:And here's what Node.js does:
Notice how the 2. step from the spec is all the way at the bottom which means that the host was already parsed and assigned to the URL whereas in the spec, if
stateOverride === kHostname
then it returns early.I wanted to ask if there is a reason why Node diverges from the spec here or if this is a bug?
How often does it reproduce? Is there a required condition?
/
What is the expected behavior?
/
What do you see instead?
/
Additional information
/
The text was updated successfully, but these errors were encountered: