Support IPv6 literal
According to https://tools.ietf.org/html/rfc3986#section-3.2.2 for any URL the IPv6 literal must be enclosed in square brackets.
This implementation assumes anything remaining after the brackets is the port.
Valid URLs
> Url.fromString "http://[2001:db8:a0b:12f0::1]/index.html"
Just { fragment = Nothing, host = "[2001:db8:a0b:12f0::1]", path = "/index.html", port_ = Nothing, protocol = Http, query = Nothing }
> Url.fromString "http://[2001:db8:a0b:12f0::1]:80/index.html"
Just { fragment = Nothing, host = "[2001:db8:a0b:12f0::1]", path = "/index.html", port_ = Just 80, protocol = Http, query = Nothing }
Rejected URLs
> Url.fromString "http://[/index.html" -- missing ]
Nothing
This fixes https://github.com/elm/url/issues/12
@evancz i saw you have submitted some PRs in Elm/Url. Don't know who is the Maintainer for this git. Can this code be merged? we are having this issue
@AlexanderEkdahl can you let me know how we can use your fix and compile our code?
@venkatbvc I am not able to provide support in this matter as I no longer actively work with Elm.
Lines 167-180 change the whitespace of the code there but do not introduce any code changes. A patch should not introduce whitespace only changes, and only modify the lines it really needs to.
Seems like a good patch other than that.
Can a new minimal patch be made for this?