Skip to content

Commit

Permalink
fix: http3 resolving ipv6 addresses (#2305)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar authored Jun 4, 2024
1 parent 57acdc1 commit 695bc04
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/async_impl/h3_client/connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ impl H3Connector {
}

pub async fn connect(&mut self, dest: Uri) -> Result<H3Connection, BoxError> {
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() {
Expand Down

0 comments on commit 695bc04

Please sign in to comment.