Skip to content

Checking for valid IP address #2

Open

Description

@devikasondhi

Hello,

The implementation for assertValidHostname seems to be checking for validity of an IP address as well. However, the checks on ipv4 seem weak. For instance, the following are invalid, while the function does not throw any exception:
124.14.32.abc (invalid characters)
231.54.11.987 (range of last octet incorrect)
23.64.12 (incorrect number of octets)
Also, ipv6 does not seem to be supported. For instance, 2001:0438:FFFE:0000:0000:0000:0000:0A35 should be valid.

Activity

  1. tomansill commented on Sep 28, 2020

    @tomansill
    Owner

    Ok I will have a look at this. Thank you for the report.

  2. tomansill commented on Sep 28, 2020

    @tomansill
    Owner

    Okay, I have came up with a solution. The solution is not yet committed to the master yet. But the solution is that I have created assertValidIpAddress(String address).

    I couldn't simply update assertValidHostname because those "invalid IP addresses" that you have listed above are technically valid full-qualifiied domain names.

    I have also updated to accept IPv6 addresses.

    I will close this issue when the update is merged into master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions