From 695bc0463726bb243e235f17c7f8833974835ec8 Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Tue, 4 Jun 2024 11:27:08 -0400 Subject: [PATCH] fix: http3 resolving ipv6 addresses (#2305) --- src/async_impl/h3_client/connect.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/async_impl/h3_client/connect.rs b/src/async_impl/h3_client/connect.rs index 1d7f4a3cf..2cce1cf47 100644 --- a/src/async_impl/h3_client/connect.rs +++ b/src/async_impl/h3_client/connect.rs @@ -47,7 +47,11 @@ impl H3Connector { } pub async fn connect(&mut self, dest: Uri) -> Result { - let host = dest.host().ok_or("destination must have a host")?; + let host = dest + .host() + .ok_or("destination must have a host")? + .trim_start_matches('[') + .trim_end_matches(']'); let port = dest.port_u16().unwrap_or(443); let addrs = if let Some(addr) = IpAddr::from_str(host).ok() {