URI.parse does not support IPv6 URLs #1663

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

Comments

Projects
None yet
3 participants
@Nicd
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@josevalim

josevalim Aug 28, 2013

Member

Good catch! A pull request is appreciated. :)

Member

josevalim commented Aug 28, 2013

Good catch! A pull request is appreciated. :)

@Nicd

This comment has been minimized.

Show comment
Hide comment
@Nicd

Nicd Aug 28, 2013

Contributor

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.

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@brunoro

brunoro Aug 29, 2013

Contributor

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.

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@Nicd

Nicd Aug 29, 2013

Contributor

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

Contributor

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). ^_^

@josevalim josevalim closed this Aug 31, 2013

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