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

IPv6 address URL parsing fails #2362

Closed
bkoenig opened this Issue Aug 30, 2011 · 3 comments

Comments

Projects
None yet
3 participants
@bkoenig

bkoenig commented Aug 30, 2011

If you use jQuery Mobile with an IPv6 address in the URL, e.g.

http://[3fff:cafe:babe::]:443/foo

then it won't work at all because URL parsing fails. I fixed the hostname part of the urlParseRE to make it work.

Currently it reads
([^:/#?]+)
At first disallow [ and ] in hostnames:
([^[]:/#?]+)
Then add the special IPv6 case as an alternative:
([^[]:/#?]+|[[0-9a-fA-F:]+])

Please review.

Thank you and best regards
Björn

@ghost ghost assigned jblas and johnbender Aug 30, 2011

@johnbender

This comment has been minimized.

Show comment
Hide comment
@johnbender

johnbender Aug 30, 2011

Contributor

Based on my reading here: http://www.ietf.org/rfc/rfc3986.txt I made alterations to prevent matching on the reserved characters described in section 3.2.2 for the host portion.

/([^:\/#\?\]\[]+|\[[^\/\]@#\?]+\])/

Any review here is appreciated, and if you feel particularly energetic we'd love some additions to the test suite if you spot issues :D

Contributor

johnbender commented Aug 30, 2011

Based on my reading here: http://www.ietf.org/rfc/rfc3986.txt I made alterations to prevent matching on the reserved characters described in section 3.2.2 for the host portion.

/([^:\/#\?\]\[]+|\[[^\/\]@#\?]+\])/

Any review here is appreciated, and if you feel particularly energetic we'd love some additions to the test suite if you spot issues :D

@jblas

This comment has been minimized.

Show comment
Hide comment
@jblas

jblas Aug 30, 2011

Contributor

@bkoenig

Thanks for catching the problem.

@johnbender

Looks good. Thanks for landing the final fix and for the tests!

Contributor

jblas commented Aug 30, 2011

@bkoenig

Thanks for catching the problem.

@johnbender

Looks good. Thanks for landing the final fix and for the tests!

@johnbender

This comment has been minimized.

Show comment
Hide comment
@johnbender

johnbender Aug 31, 2011

Contributor

@jblas

For you? Anything. :D

Contributor

johnbender commented Aug 31, 2011

@jblas

For you? Anything. :D

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