Repository navigation
Commit 586666e
authored
The URL regex was unanchored at the end, so fromURL would silently
truncate trailing non-hex characters and return a partial address —
e.g. `http://[1234:5678::abcdxyz]` parsed as `1234:5678::abcd`.
Anchor both URL regexes, pair the brackets so `[hex]` and bare `hex`
are exclusive alternatives, and accept `.` for v4-in-v6 addresses.
Strip the protocol prefix up front and route every non-port URL
through a single regex branch.
1 parent 80bc76e commit 586666e
4 files changed
Lines changed: 139 additions & 106 deletions
0 commit comments