-
-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ba7a37
commit 02d9eed
Showing
5 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,6 +128,8 @@ pub struct Filter { | |
pub exclude_loopback_ips: bool, | ||
/// Example: [email protected] | ||
pub include_mail: bool, | ||
/// Example: 1234567890 | ||
pub include_tel: bool, | ||
} | ||
|
||
impl Filter { | ||
|
@@ -138,6 +140,13 @@ impl Filter { | |
uri.is_mail() && !self.include_mail | ||
} | ||
|
||
#[inline] | ||
#[must_use] | ||
/// Whether tel aren't checked (which is the default) | ||
pub fn is_tel_excluded(&self, uri: &Uri) -> bool { | ||
uri.is_tel() && !self.include_tel | ||
} | ||
|
||
#[must_use] | ||
/// Whether the IP address is excluded from checking | ||
pub fn is_ip_excluded(&self, uri: &Uri) -> bool { | ||
|
@@ -214,6 +223,7 @@ impl Filter { | |
|| self.is_host_excluded(uri) | ||
|| self.is_ip_excluded(uri) | ||
|| self.is_mail_excluded(uri) | ||
|| self.is_tel_excluded(uri) | ||
|| is_example_domain(uri) | ||
|| is_unsupported_domain(uri) | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters