diff --git a/src/normalizer.rs b/src/normalizer.rs index d2d5419..03f8abd 100644 --- a/src/normalizer.rs +++ b/src/normalizer.rs @@ -45,7 +45,7 @@ pub(crate) fn normalize(u: Uri<&str>) -> Uri { #[cfg(feature = "net")] HostMeta::Ipv6(addr) => write!(buf, "[{addr}]").unwrap(), #[cfg(not(feature = "net"))] - HostMeta::Ipv6(..) => { + HostMeta::Ipv6() => { buf.push('['); write_v6(&mut buf, parser::parse_v6(&auth.host().as_bytes()[1..])); buf.push(']'); diff --git a/src/resolver.rs b/src/resolver.rs index 0c9e639..78c11e4 100644 --- a/src/resolver.rs +++ b/src/resolver.rs @@ -53,21 +53,8 @@ pub(crate) fn resolve( if r_path.is_absolute() { t_path = remove_dot_segments(&mut buf, r_path.as_str()); } else { + // Instead of merging the paths, remove dot segments incrementally. let base_path = base.path().as_str(); - - // let merged_path = if base_path.is_empty() { - // alloc::format!("/{base_path}") - // } else { - // alloc::format!( - // "{}/{}", - // base_path.rsplit_once('/').unwrap().0, - // r_path.as_str() - // ) - // }; - // t_path = remove_dot_segments(&mut buf, &merged_path); - - // Merging paths like above requires another allocation. - if base_path.is_empty() { buf.push('/'); } else {