mirror of
https://github.com/GyulyVGC/sniffnet.git
synced 2026-08-27 03:49:31 +00:00
Merge pull request #1275 from cuyua9/fix/favorites-unresolved-host-filter-cuyua9
fix(inspect): allow favorites for unresolved hosts
This commit is contained in:
commit
d1016a8b99
1 changed files with 26 additions and 4 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue