Skip to content

Commit 695bc04

Browse files
authored
fix: http3 resolving ipv6 addresses (#2305)
1 parent 57acdc1 commit 695bc04

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/async_impl/h3_client/connect.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ impl H3Connector {
4747
}
4848

4949
pub async fn connect(&mut self, dest: Uri) -> Result<H3Connection, BoxError> {
50-
let host = dest.host().ok_or("destination must have a host")?;
50+
let host = dest
51+
.host()
52+
.ok_or("destination must have a host")?
53+
.trim_start_matches('[')
54+
.trim_end_matches(']');
5155
let port = dest.port_u16().unwrap_or(443);
5256

5357
let addrs = if let Some(addr) = IpAddr::from_str(host).ok() {

0 commit comments

Comments
 (0)