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

Weird URL constructor behavior since 18.16.0 #51619

Closed
JSMonk opened this issue Jan 31, 2024 · 8 comments
Closed

Weird URL constructor behavior since 18.16.0 #51619

JSMonk opened this issue Jan 31, 2024 · 8 comments
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs. whatwg-url Issues and PRs related to the WHATWG URL implementation.

Comments

@JSMonk
Copy link

JSMonk commented Jan 31, 2024

Version

from 18.16.0 to 21.6.1

Platform

Darwin NVC00566 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:55:06 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6020 arm64

Subsystem

No response

What steps will reproduce the bug?

So, to see the behavior, we need to compare two versions of Node.js. Let's take 18.15.0 and any version from (and including) 18.16.0.

  1. Open REPL
  2. Put new URL("https://0.0.0.0x100/")
  3. On 18.15.0 (and earlier versions), a TypeError: [ERR_INVALID_URL]: Invalid URL; on 18.16.0, the URL will be parsed as valid. Browsers such as Firefox v122 and Chrome v121.0.6167.85 also throw the error.

How often does it reproduce? Is there a required condition?

In 10 cases of 10

What is the expected behavior? Why is that the expected behavior?

The string should be accepted as an invalid URL, and the constructor should throw TypeError: [ERR_INVALID_URL]: Invalid URL

What do you see instead?

An URL object with 'https://0.0.1.0/ href

Additional information

No response

@richardlau
Copy link
Member

cc @nodejs/url

@lemire
Copy link
Member

lemire commented Jan 31, 2024

Duplicate: #51514

Already fixed.

@anonrig anonrig added the whatwg-url Issues and PRs related to the WHATWG URL implementation. label Jan 31, 2024
@lemire
Copy link
Member

lemire commented Jan 31, 2024

I recommend closing this issue. The fix is at #51542

@lemire lemire added the duplicate Issues and PRs that are duplicates of other issues or PRs. label Jan 31, 2024
@JSMonk JSMonk closed this as completed Jan 31, 2024
@JSMonk
Copy link
Author

JSMonk commented Feb 1, 2024

@lemire, To which versions will this fix be backported?

@lemire
Copy link
Member

lemire commented Feb 1, 2024

@anonrig Please see @JSMonk's question.

@anonrig
Copy link
Member

anonrig commented Feb 1, 2024

@lemire, To which versions will this fix be backported?

It will be backported to all release lines (18, 20 and 21)

@JSMonk
Copy link
Author

JSMonk commented Feb 19, 2024

@anonrig Has it been included in 21.6.2?

@anonrig
Copy link
Member

anonrig commented Feb 19, 2024

@anonrig Has it been included in 21.6.2?

Afaict, it isn't included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs. whatwg-url Issues and PRs related to the WHATWG URL implementation.
Projects
None yet
Development

No branches or pull requests

4 participants