Skip to content

The private IP range improvament #138

@ColdByDefault

Description

@ColdByDefault

The private IP range check for 172.x.x.x is incomplete. The private IP range is only 172.16.0.0/12 (172.16.0.0 to 172.31.255.255), but this code treats all IPs starting with "172." as private, including public IP ranges like 172.0.x.x through 172.15.x.x and 172.32.x.x through 172.255.x.x. This could cause incorrect geolocation lookups to be skipped for valid public IPs.

Consider using a more accurate check:

  • For 172.x ranges, verify that the second octet is between 16 and 31
  • Alternatively, use a library for proper IP range validation

Originally posted by @Copilot in #135 (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