Skip to content

Commit 586666e

Browse files
Reject trailing junk in Address6.fromURL (closes #158) (#202)
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

File tree

0 commit comments

Comments
 (0)