Skip to content

net.isIP detection issue #40173

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

Closed
7c opened this issue Sep 21, 2021 · 1 comment
Closed

net.isIP detection issue #40173

7c opened this issue Sep 21, 2021 · 1 comment
Labels
net Issues and PRs related to the net subsystem.

Comments

@7c
Copy link

7c commented Sep 21, 2021

Version

v14.17.6

Platform

Linux 5.11.0-1017-aws #18~20.04.1-Ubuntu SMP Fri Aug 27 11:21:54 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

net.isIP('116.68.99.3') // returns 4
net.isIP('116.68.99.03') // returns 0

everywhere on linux '116.68.99.03' is a valid IP address and notation

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

tested on ubuntu8,10,14 on linux and mac.

What is the expected behavior?

should return 4

What do you see instead?

i see 0, which says it is an invalid IP address

Additional information

No response

@Mesteery Mesteery added the net Issues and PRs related to the net subsystem. label Sep 21, 2021
VoltrexKeyva added a commit to VoltrexKeyva/node that referenced this issue Sep 21, 2021
Fixed the IPv4's validation regex so it also matches IPv4 octets that are prefixed by a `0` as they're also considered valid octets.

Fixes: nodejs#40173
VoltrexKeyva added a commit to VoltrexKeyva/node that referenced this issue Sep 21, 2021
Fixed the IPv4's validation regex so it also matches IPv4 octets that
are prefixed by a `0` as they're also considered valid octets.

Fixes: nodejs#40173
VoltrexKeyva added a commit to VoltrexKeyva/node that referenced this issue Sep 21, 2021
Fixed the IPv4's validation regex so it also matches IPv4 octets that
are prefixed by a `0` as they're also considered valid octets.

Fixes: nodejs#40173
@VoltrexKeyva VoltrexKeyva added the confirmed-bug Issues with confirmed bugs. label Sep 21, 2021
VoltrexKeyva added a commit to VoltrexKeyva/node that referenced this issue Sep 21, 2021
Fixed the IPv4's validation regex so it also matches IPv4 octets that
are prefixed by a `0` as they're also considered valid octets.

Fixes: nodejs#40173
@VoltrexKeyva VoltrexKeyva removed the confirmed-bug Issues with confirmed bugs. label Sep 22, 2021
@VoltrexKeyva
Copy link
Member

Refs: #40174

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
net Issues and PRs related to the net subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants