Skip to content

Commit

Permalink
fix(client): remove ipv6 square brackets before resolving
Browse files Browse the repository at this point in the history
  • Loading branch information
rcgoodfellow authored and seanmonstar committed Oct 13, 2021
1 parent 1d553e5 commit 910e026
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
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

0 comments on commit 910e026

Please sign in to comment.