Skip to content
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

URI.parse does not support IPv6 URLs #1663

Closed
Nicd opened this issue Aug 28, 2013 · 4 comments
Closed

URI.parse does not support IPv6 URLs #1663

Nicd opened this issue Aug 28, 2013 · 4 comments

Comments

@Nicd
Copy link
Contributor

@Nicd Nicd commented Aug 28, 2013

Try the following:

URI.parse("http://[2607:f3f0:2:0:216:3cff:fef0:174a]/").authority

Expected result: "[2607:f3f0:2:0:216:3cff:fef0:174a]"
Actual result: "[2607"

Running Elixir 0.10.2-dev.

@josevalim
Copy link
Member

@josevalim josevalim commented Aug 28, 2013

Good catch! A pull request is appreciated. :)

@Nicd
Copy link
Contributor Author

@Nicd Nicd commented Aug 28, 2013

I'm fairly sure the problem is in the regex at uri.ex#L195, which does not take into account that IPv6 URLs have : inside them in places other than the port number. I will look into this when I get the time.

@brunoro
Copy link
Contributor

@brunoro brunoro commented Aug 29, 2013

The regexp used for parsing URIs comes from RFC3986 (http://tools.ietf.org/html/rfc3986#appendix-B), which already takes into account IPv6 addresses. You're right @Nicd, it comes from that other regexp used for splitting the authority.

@Nicd
Copy link
Contributor Author

@Nicd Nicd commented Aug 29, 2013

I am honored to have my server's IPv6 address appear in Elixir's source code (if this pull request goes through). ^_^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants