From e11564a76e7a6bc33428cb83cec887bf821bbbb1 Mon Sep 17 00:00:00 2001 From: cuyua9 <2114364329@qq.com> Date: Sat, 15 Aug 2026 07:18:59 +0800 Subject: [PATCH] fix(inspect): allow favorites for unresolved hosts --- src/report/types/search_parameters.rs | 30 +++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/src/report/types/search_parameters.rs b/src/report/types/search_parameters.rs index ec2ce6fa..34f715ea 100644 --- a/src/report/types/search_parameters.rs +++ b/src/report/types/search_parameters.rs @@ -68,10 +68,7 @@ impl SearchParameters { } fn is_some_host_filter_active(&self) -> bool { - self.only_favorites - || !self.country.is_empty() - || !self.as_name.is_empty() - || !self.domain.is_empty() + !self.country.is_empty() || !self.as_name.is_empty() || !self.domain.is_empty() } pub fn new_host_search(host: &Host) -> Self { @@ -102,6 +99,31 @@ impl SearchParameters { } } +#[cfg(test)] +mod tests { + use super::SearchParameters; + + #[test] + fn favorites_only_does_not_require_reverse_dns() { + let search = SearchParameters { + only_favorites: true, + ..SearchParameters::default() + }; + + assert!(!search.is_some_host_filter_active()); + } + + #[test] + fn host_filters_still_require_reverse_dns() { + let search = SearchParameters { + domain: "example.com".to_string(), + ..SearchParameters::default() + }; + + assert!(search.is_some_host_filter_active()); + } +} + #[derive(Copy, Clone)] pub enum FilterInputType { AddressSrc,