As pointed out in #110 its not possible to do new URLPattern("http://[::1]/"). Even if you properly escape the colons like new URLPattern("http://[\\:\\:1]/") it still throws.
Adding support for this turns out to not be too hard. The URL spec simply ignores colons inside [ ] brackets. We can do the same in URLPattern. Of course, for the hostname pattern to be valid the colon's will still need to be escaped.
As pointed out in #110 its not possible to do
new URLPattern("http://[::1]/")
. Even if you properly escape the colons likenew URLPattern("http://[\\:\\:1]/")
it still throws.Adding support for this turns out to not be too hard. The URL spec simply ignores colons inside
[ ]
brackets. We can do the same in URLPattern. Of course, for the hostname pattern to be valid the colon's will still need to be escaped.