Skip to content

Commit

Permalink
doc: add note to net.isIP() about limitations
Browse files Browse the repository at this point in the history
Closes: #40966
  • Loading branch information
Trott committed Nov 30, 2021
1 parent 6d8ab76 commit baeb2bb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions doc/api/net.md
Expand Up @@ -1483,6 +1483,10 @@ Tests if input is an IP address. Returns `0` for invalid strings,
returns `4` for IP version 4 addresses, and returns `6` for IP version 6
addresses.

`net.isIP()` validates conventional IP formats only. There are some
technically permissible IP formats that it will reject. In practice, the formats
that it rejects are not widely used except perhaps for malicious purposes.

## `net.isIPv4(input)`

<!-- YAML
Expand All @@ -1494,6 +1498,10 @@ added: v0.3.0

Returns `true` if input is a version 4 IP address, otherwise returns `false`.

`net.isIPv4()` validates conventional IP formats only. There are some
technically permissible IP formats that it will reject. In practice, the formats
that it rejects are not widely used except perhaps for malicious purposes.

## `net.isIPv6(input)`

<!-- YAML
Expand Down

0 comments on commit baeb2bb

Please sign in to comment.