Skip to content

Commit 55377ec

Browse files
committed
Fix invalid IPv6 IRI
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.
1 parent 71843cb commit 55377ec

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/draft7/optional/format/iri.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,14 @@
2525
},
2626
{
2727
"description": "a valid IRI based on IPv6",
28-
"data": "http://2001:0db8:85a3:0000:0000:8a2e:0370:7334",
28+
"data": "http://[2001:0db8:85a3:0000:0000:8a2e:0370]:7334",
2929
"valid": true
3030
},
31+
{
32+
"description": "an invalid IRI based on IPv6",
33+
"data": "http://2001:0db8:85a3:0000:0000:8a2e:0370:7334",
34+
"valid": false
35+
},
3136
{
3237
"description": "an invalid relative IRI Reference",
3338
"data": "/abc",

0 commit comments

Comments
 (0)