Merge pull request #1275 from cuyua9/fix/favorites-unresolved-host-filter-cuyua9

fix(inspect): allow favorites for unresolved hosts
This commit is contained in:
Giuliano Bellini 2026-08-16 17:08:01 +02:00 committed by GitHub
commit d1016a8b99
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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,