diff --git a/Cargo.toml b/Cargo.toml index 3ea51dd..3027273 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ rust-version = "1.82.0" base16 = "0.2.1" base64 = "0.21.5" byteorder = "1.5.0" -bytes = "1.5.0" +bytes = "1.9.0" chrono = "0.4.38" clap = "4.5.9" colored = "2.2.0" diff --git a/src/transport/endpoint.rs b/src/transport/endpoint.rs index 721210d..1ce9d20 100644 --- a/src/transport/endpoint.rs +++ b/src/transport/endpoint.rs @@ -94,7 +94,7 @@ impl EndPoint { // true if all addresses in addrs field are ipv6 pub fn is_ipv6(&self) -> bool { - self.addrs.iter().all(|a| a.is_ipv6()) + !self.addrs.is_empty() && self.addrs.iter().all(|a| a.is_ipv6()) } // test if a string ip is IPV6. Used to disambiguate from cases where port is added diff --git a/tests/venom/endpoint-ipv4.yml b/tests/venom/endpoint-ipv4.yml index 66bacf7..637d5df 100644 --- a/tests/venom/endpoint-ipv4.yml +++ b/tests/venom/endpoint-ipv4.yml @@ -3,7 +3,7 @@ name: DQY binary test (endpoints v4) testcases: - name: use host resolver steps: - - script: dqy A www.google.com + - script: dqy A www.google.com -vvvvv assertions: - result.code ShouldEqual 0