Skip to content

Fix invalid IPv6 IRI #213

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

Merged
merged 1 commit into from
Mar 25, 2018
Merged

Conversation

davishmcclurg
Copy link
Contributor

IPv6 URIs (and IRIs) require square brackets around the IP address.

https://tools.ietf.org/html/rfc3986#section-3.2.2

A host identified by an Internet Protocol literal address, version 6
[RFC3513] or later, is distinguished by enclosing the IP literal
within square brackets ("[" and "]"). This is the only place where
square bracket characters are allowed in the URI syntax.

@@ -25,9 +25,14 @@
},
{
"description": "a valid IRI based on IPv6",
"data": "http://2001:0db8:85a3:0000:0000:8a2e:0370:7334",
"data": "http://[2001:0db8:85a3:0000:0000:8a2e:0370]:7334",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a valid IRI as 2001:0db8:85a3:0000:0000:8a2e:0370 is not a valid IPv6 (8 segments required).
http://[2001:0db8:85a3:0000:0000:8a2e:0370:7334] this is correct IRI (:7334 is not a port).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Thanks @vearutop

IPv6 URIs (and IRIs) require square brackets around the IP address.

https://tools.ietf.org/html/rfc3986#section-3.2.2

> A host identified by an Internet Protocol literal address, version 6
> [RFC3513] or later, is distinguished by enclosing the IP literal
> within square brackets ("[" and "]").  This is the only place where
> square bracket characters are allowed in the URI syntax.
davishmcclurg added a commit to davishmcclurg/json_schemer that referenced this pull request Jan 30, 2018
@handrews handrews merged commit b242817 into json-schema-org:master Mar 25, 2018
@handrews
Copy link
Contributor

Thanks! Sorry I hadn't noticed this PR, I just found out my spam filter's been eating some random percentage of GitHub notification :-/

@davishmcclurg davishmcclurg deleted the ipv6-iri-format branch April 4, 2018 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants