This commit is contained in:
JMARyA 2024-12-30 09:57:42 +01:00
parent 9b96a21906
commit 654d4b9cba
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
7 changed files with 222 additions and 105 deletions

View file

@ -1,3 +1,7 @@
/// Checks if a domain is present in the blacklist of unwanted domains.
///
/// This function checks the `$BLACKLIST_DOMAINS` environment variable for a comma-separated list of regular expressions to match against.
/// If a match is found, it immediately returns `true`. Otherwise, it returns `false`.
pub fn check_blacklist(domain: &str) -> bool {
let blacklist_raw = std::env::var("BLACKLIST_DOMAINS").unwrap_or_default();