diff --git a/crates/mysten-network/src/multiaddr.rs b/crates/mysten-network/src/multiaddr.rs index b628f6a4bdf97a..206363623786d1 100644 --- a/crates/mysten-network/src/multiaddr.rs +++ b/crates/mysten-network/src/multiaddr.rs @@ -260,13 +260,10 @@ pub(crate) fn parse_tcp<'a, T: Iterator>>(protocols: &mut T) pub(crate) fn parse_http_https<'a, T: Iterator>>( protocols: &mut T, ) -> Result<&'static str> { - match protocols - .next() - .ok_or_else(|| eyre!("unexpected end of multiaddr"))? - { - Protocol::Http => Ok("http"), - Protocol::Https => Ok("https"), - _ => Err(eyre!("expected http/https protocol")), + match protocols.next() { + Some(Protocol::Http) => Ok("http"), + Some(Protocol::Https) => Ok("https"), + _ => Ok("http"), } } diff --git a/crates/mysten-network/src/server.rs b/crates/mysten-network/src/server.rs index 7842ef7100837f..bbeb4d63d33c37 100644 --- a/crates/mysten-network/src/server.rs +++ b/crates/mysten-network/src/server.rs @@ -467,13 +467,6 @@ mod test { test_multiaddr(address).await; std::fs::remove_file(path).unwrap(); } - - #[should_panic] - #[tokio::test] - async fn missing_http_protocol() { - let address: Multiaddr = "/dns/localhost/tcp/0".parse().unwrap(); - test_multiaddr(address).await; - } } #[derive(Clone)]