-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
parsing breaks with IPv4-mapped IPv6 addresses #8
Comments
@thaJeztah is there a reason we've changed this behaviour 🤔 |
I don't think there's a specific reason, other than potentially to reduce complexity of the regex; I recall I suggested reducing the scope of the regex for this purpose (and handle further processing after this) in distribution/distribution#3489 (comment) So, I think the current implementation was done to provide the (minimum) requirements for IPv6 addresses at that time, and the documentation was added to reflect what's supported to prevent false expectations; see distribution/distribution#3489 (comment) We must make sure that there's no ambiguity in such references, as the "is it a domain?", "is it an IP?" or "is it a namespace on the default registry?" is already complex, and allowed formats of IPv6 addresses is a bit of a wild-west, but I THINK with the requirement to have these addresses using the notation with square brackets ( |
Aha! I remember that PR now. Solid |
The IPv6 address syntax allows forms such as
::ffff:192.0.2.128
, but the reference parsing code, despite allowing other forms of IPv6 address, doesn't seem to allow these, even though the Go net package does.For example, running against commit 8507c7f, this code fails:
The error it prints is:
Although the code says "Special addresses such as IPv4-Mapped are deliberately excluded", ISTM that that exclusion is not entirely warranted, as it's reasonable to specify an address in this way. The same cannot be said of zone identifiers.
The text was updated successfully, but these errors were encountered: