summaryrefslogtreecommitdiff
path: root/searx/botdetection/http_sec_fetch.py
diff options
context:
space:
mode:
Diffstat (limited to 'searx/botdetection/http_sec_fetch.py')
-rw-r--r--searx/botdetection/http_sec_fetch.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/searx/botdetection/http_sec_fetch.py b/searx/botdetection/http_sec_fetch.py
index 5f16d1d9b..f64ee4b2c 100644
--- a/searx/botdetection/http_sec_fetch.py
+++ b/searx/botdetection/http_sec_fetch.py
@@ -82,6 +82,12 @@ def filter_request(
cfg: config.Config,
) -> werkzeug.Response | None:
+ if not request.is_secure:
+ logger.warning(
+ "Sec-Fetch cannot be verified for non-secure requests (HTTP headers are not set/sent by the client)."
+ )
+ return None
+
# Only check Sec-Fetch headers for supported browsers
user_agent = request.headers.get('User-Agent', '')
if is_browser_supported(user_agent):