Skip to content

Commit

Permalink
URLPattern: Support constructor strings with ipv6 addresses.
Browse files Browse the repository at this point in the history
This adds support for constructor strings like:

  new URLPattern("http://[\\:\\:1]/");

As discussed in spec issue #113:

  whatwg/urlpattern#113

Fixed: 1245760
Change-Id: I712341e72a5c2af745dbbdbb8673a79809a98425
  • Loading branch information
wanderview authored and chromium-wpt-export-bot committed Sep 1, 2021
1 parent 77c08dc commit 61a2451
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions urlpattern/resources/urlpatterntestdata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2150,6 +2150,39 @@
"pathname": { "input": "/data:channel.html", "groups": {} }
}
},
{
"pattern": [ "http://[\\:\\:1]/" ],
"inputs": [ "http://[::1]/" ],
"exactly_empty_components": [ "username", "password", "port", "search",
"hash" ],
"expected_obj": {
"protocol": "http",
"hostname": "[\\:\\:1]",
"pathname": "/"
},
"expected_match": {
"protocol": { "input": "http", "groups": {} },
"hostname": { "input": "[::1]", "groups": {} },
"pathname": { "input": "/", "groups": {} }
}
},
{
"pattern": [ "http://[\\:\\:1]:8080/" ],
"inputs": [ "http://[::1]:8080/" ],
"exactly_empty_components": [ "username", "password", "search", "hash" ],
"expected_obj": {
"protocol": "http",
"hostname": "[\\:\\:1]",
"port": "8080",
"pathname": "/"
},
"expected_match": {
"protocol": { "input": "http", "groups": {} },
"hostname": { "input": "[::1]", "groups": {} },
"port": { "input": "8080", "groups": {} },
"pathname": { "input": "/", "groups": {} }
}
},
{
"pattern": [ "https://foo{{@}}example.com" ],
"inputs": [ "https://foo@example.com" ],
Expand Down

0 comments on commit 61a2451

Please sign in to comment.