4 Commits

Author SHA1 Message Date
benpiano800
bc06b1aece [enh] plugins: tor_check: Add more keywords (#4726)
Previously, there was only one usable keyword for the tor_check plugin. Adding more keywords eliminates confusion.
2025-05-07 10:39:46 +02:00
Brock Vojkovic
ff60fe635f [fix] sec-fetch-* blocking infinite scroll (#4728) 2025-05-07 10:38:21 +02:00
Markus Heiser
6e7119fa4e [fix] references from searx.botdetection.http_sec_fetch (#4723) 2025-05-07 10:25:47 +02:00
Ivan Gabaldon
f52cd3f008 missing dependency for armv7 (#4727) 2025-05-07 08:53:34 +02:00
4 changed files with 9 additions and 7 deletions

View File

@@ -48,6 +48,8 @@ RUN apt-get update \
&& apt-get install -y --no-install-recommends \
# healthcheck
wget \
# lxml (ARMv7)
libxslt1.1 \
# uwsgi
libpcre3 \
libxml2 \

View File

@@ -53,7 +53,7 @@ Probe HTTP headers
.. automodule:: searx.botdetection.http_user_agent
:members:
.. automodule:: searx.botdetection.sec_fetch
.. automodule:: searx.botdetection.http_sec_fetch
:members:
.. _botdetection config:

View File

@@ -12,10 +12,10 @@ Metadata`_. A request is filtered out in case of:
.. _Fetch Metadata:
https://developer.mozilla.org/en-US/docs/Glossary/Fetch_metadata_request_header
.. Sec-Fetch-Dest:
.. _Sec-Fetch-Dest:
https://developer.mozilla.org/en-US/docs/Web/API/Request/destination
.. Sec-Fetch-Mode:
.. _Sec-Fetch-Mode:
https://developer.mozilla.org/en-US/docs/Web/API/Request/mode
@@ -86,7 +86,7 @@ def filter_request(
user_agent = request.headers.get('User-Agent', '')
if is_browser_supported(user_agent):
val = request.headers.get("Sec-Fetch-Mode", "")
if val != "navigate":
if val not in ('navigate', 'cors'):
logger.debug("invalid Sec-Fetch-Mode '%s'", val)
return flask.redirect(flask.url_for('index'), code=302)
@@ -96,7 +96,7 @@ def filter_request(
flask.redirect(flask.url_for('index'), code=302)
val = request.headers.get("Sec-Fetch-Dest", "")
if val != "document":
if val not in ('document', 'empty'):
logger.debug("invalid Sec-Fetch-Dest '%s'", val)
flask.redirect(flask.url_for('index'), code=302)

View File

@@ -33,7 +33,7 @@ class SXNGPlugin(Plugin):
"""Rewrite hostnames, remove results or prioritize them."""
id = "tor_check"
keywords = ["tor-check"]
keywords = ["tor-check", "tor_check", "torcheck", "tor", "tor check"]
def __init__(self, plg_cfg: "PluginCfg") -> None:
super().__init__(plg_cfg)
@@ -53,7 +53,7 @@ class SXNGPlugin(Plugin):
if search.search_query.pageno > 1:
return results
if search.search_query.query.lower() == "tor-check":
if search.search_query.query.lower() in self.keywords:
# Request the list of tor exit nodes.
try: