Skip to content

Commit 910e026

Browse files
rcgoodfellowseanmonstar
authored andcommittedOct 13, 2021
fix(client): remove ipv6 square brackets before resolving
1 parent 1d553e5 commit 910e026

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed
 

‎src/client/connect/dns.rs

-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ impl SocketAddrs {
191191
iter: vec![SocketAddr::V4(addr)].into_iter(),
192192
});
193193
}
194-
let host = host.trim_start_matches('[').trim_end_matches(']');
195194
if let Ok(addr) = host.parse::<Ipv6Addr>() {
196195
let addr = SocketAddrV6::new(addr, port, 0, 0);
197196
return Some(SocketAddrs {

‎src/client/connect/http.rs

+1
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ where
326326
let config = &self.config;
327327

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

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

0 commit comments

Comments
 (0)
Please sign in to comment.