diff --git a/src/config/parser.rs b/src/config/parser.rs index e3b3588..4490bc6 100644 --- a/src/config/parser.rs +++ b/src/config/parser.rs @@ -34,7 +34,7 @@ pub struct Config { pub threads: u8, /// It stores configuration options for the ratelimiting middleware. pub rate_limiter: RateLimiter, - /// It stores the level of safe search to be used for restricting content in the + /// It stores the level of safe search to be used for restricting content in the /// search results. pub safe_search: u8, } diff --git a/src/server/routes.rs b/src/server/routes.rs index 29b36aa..57aa413 100644 --- a/src/server/routes.rs +++ b/src/server/routes.rs @@ -33,6 +33,8 @@ struct SearchParams { /// It stores the search parameter `page` (or pageno in simple words) /// of the search url. page: Option, + /// It stores the search parameter `safesearch` (or safe search level in simple words) of the + /// search url. safesearch: Option, } @@ -275,6 +277,8 @@ async fn results( } } +/// A helper function which checks whether the search query contains any keywords which should be +/// disallowed/allowed based on the regex based rules present in the blocklist and allowlist files. fn is_match_from_filter_list( file_path: &str, query: &str,