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

HostAndPort to support parsing ip+port string #2412

Merged
merged 9 commits into from
Nov 4, 2022

Conversation

Scottmitch
Copy link
Member

Motivation:
Parsing HostAndPort from 'ip+port' string is a common case, but we don't have tooling to support this.

Motivation:
Parsing HostAndPort from 'ip+port' string is a common case, but
we don't have tooling to support this.
@Scottmitch Scottmitch marked this pull request as ready for review November 2, 2022 00:01
@@ -30,8 +46,86 @@ final class DefaultHostAndPort implements HostAndPort {
* @param port the port.
*/
DefaultHostAndPort(String hostName, int port) {
if (isValidIpV6Address(requireNonNull(hostName))) { // Normalize ipv6 so equals/hashCode works as expected
Copy link
Member Author

@Scottmitch Scottmitch Nov 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@idelpivnitskiy - note that I changed IPv6 do compression to be consistent in all cases.

Copy link
Member

@idelpivnitskiy idelpivnitskiy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@Scottmitch Scottmitch merged commit 16d1af6 into apple:main Nov 4, 2022
@Scottmitch Scottmitch deleted the hostport_ip_parse branch November 4, 2022 00:33
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