From c60fdb8366b6244d6c6cf8061618a9734ef8aa3f Mon Sep 17 00:00:00 2001 From: neon_arch Date: Tue, 12 Sep 2023 18:53:32 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20chore:=20make=20github=20actions?= =?UTF-8?q?=20happy=20(#205)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/parser.rs | 2 +- src/server/routes.rs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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,