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

Support IPv6 URIs #82

Merged
merged 2 commits into from
Jul 25, 2019
Merged

Support IPv6 URIs #82

merged 2 commits into from
Jul 25, 2019

Conversation

foca
Copy link
Contributor

@foca foca commented Oct 20, 2016

Instead of using URI::Generic#host, we should use #hostname. The only difference between these methods is that #hostname will unwrap brackets from URIs that look like literal IPv6 addresses.

I don't know how to test this, however, short of booting up a webrick instance and actually making requests, but that seems a bit overkill.

See lostisland/faraday#621 for more background.

Instead of using `URI::Generic#host`, we should use `#hostname`. The
only difference between these methods is that `#hostname` will unwrap
brackets from URIs that look like literal IPv6 addresses.
@drbrain
Copy link
Owner

drbrain commented Oct 20, 2016

It looks like there isn't enough infrastructure to test this right now, you'd want to assert that the value passed in here is the correct IPv6 hostname, but there's no tests for that class.

I can add tests.

You may want to update the tests to use @uri.hostname (even though they don't use a URI with an IPv6 address).

@drbrain drbrain merged commit 7fee798 into drbrain:master Jul 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants