fix: Remove wrapping [] from input IP addresses #34

Merged
Aranjedeath merged 1 commit from zoe/fix-invalid-ipv6-parsing into main 2026-07-26 03:16:57 +00:00

1 commit

Author SHA1 Message Date
1883740c13 fix: Remove wrapping [] from input IP addresses
All checks were successful
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 2m9s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 4m47s
Checks / Prek / Pre-commit & Formatting (push) Successful in 41s
Checks / Prek / Clippy and Cargo Tests (push) Successful in 1m54s
This was causing IPv6 hosts to fail to parse properly, and therefore
giving results like `Named("[2a0b", "<redacted>]")` instead of
`Literal("[2a0b:<redacted>]:8448")`

Root cause: `IpAddr::from_str` expects an IP address without the brackets.
Simple fix is to add a test case with brackets, and a few lines of code
to remove the brackets if they exist.

See-Also:
 - [Start of conversation](https://matrix.to/#/!ksTlboXVgcyWjv5GrlEeKyQuJ8ZCprnwQx2b6-BQ44Q/%24ycrGAve619dUbXgiQO-OFTvXMXNy28ltyCSSek_5NpY?via=wolfgirl.pet&via=explodie.org&via=matrix.org)
 - [End of conversation](https://matrix.to/#/!ksTlboXVgcyWjv5GrlEeKyQuJ8ZCprnwQx2b6-BQ44Q/%24zKpTlRDwvymvwUcGhgqO4Agcj0eqEgDf6WFc6Q6i9D4?via=wolfgirl.pet&via=explodie.org&via=matrix.org)
2026-07-26 02:02:38 +00:00