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

fix(client): remove ipv6 square brackets before resolving #2664

Merged
merged 1 commit into from
Oct 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/client/connect/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ impl SocketAddrs {
iter: vec![SocketAddr::V4(addr)].into_iter(),
});
}
let host = host.trim_start_matches('[').trim_end_matches(']');
if let Ok(addr) = host.parse::<Ipv6Addr>() {
let addr = SocketAddrV6::new(addr, port, 0, 0);
return Some(SocketAddrs {
Expand Down
1 change: 1 addition & 0 deletions src/client/connect/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ where
let config = &self.config;

let (host, port) = get_host_port(config, &dst)?;
let host = host.trim_start_matches('[').trim_end_matches(']');

// If the host is already an IP addr (v4 or v6),
// skip resolving the dns and start connecting right away.
Expand Down