Skip to content

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