Skip to content

Internal URL parser diverges from the spec in some parts #39798

Closed
@d3lm

Description

@d3lm

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 and kHostname. Here's an excerpt from the spec:

CleanShot 2021-08-17 at 15 59 37@2x

And here's what Node.js does:

CleanShot 2021-08-18 at 09 39 23@2x

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

/

Metadata

Metadata

Assignees

No one assigned

    Labels

    whatwg-urlIssues and PRs related to the WHATWG URL implementation.wontfixIssues that will not be fixed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions