Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
d3lm opened this issue Aug 18, 2021 · 3 comments
Closed

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

d3lm opened this issue Aug 18, 2021 · 3 comments
Labels
whatwg-url Issues and PRs related to the WHATWG URL implementation. wontfix Issues that will not be fixed.

Comments

@d3lm
Copy link
Contributor

d3lm commented Aug 18, 2021

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

/

@himadriganguly himadriganguly added macos Issues and PRs related to the macOS platform / OSX. and removed macos Issues and PRs related to the macOS platform / OSX. labels Aug 18, 2021
@lpinca lpinca added the whatwg-url Issues and PRs related to the WHATWG URL implementation. label Aug 18, 2021
@jasnell
Copy link
Member

jasnell commented Aug 18, 2021

Likely just a bug :-)

@RaisinTen
Copy link
Contributor

A manual backport of #38742 to v14.x-staging will fix this

@RaisinTen
Copy link
Contributor

Since #38742 is marked as dont-land-on-v14.x because of #37877 (comment), we can't backport the required fix to v14.x. Hence, I'm closing this issue as a wontfix. Please feel free to reopen if you think otherwise.

@RaisinTen RaisinTen added the wontfix Issues that will not be fixed. label Aug 22, 2021
@targos targos added the v14.x label Aug 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
whatwg-url Issues and PRs related to the WHATWG URL implementation. wontfix Issues that will not be fixed.
Projects
None yet
Development

No branches or pull requests

6 participants