mirror of
https://github.com/searxng/searxng.git
synced 2026-07-26 18:01:33 +00:00
Compare commits
4 Commits
a2fa7de880
...
bc06b1aece
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc06b1aece | ||
|
|
ff60fe635f | ||
|
|
6e7119fa4e | ||
|
|
f52cd3f008 |
@@ -48,6 +48,8 @@ RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
# healthcheck
|
||||
wget \
|
||||
# lxml (ARMv7)
|
||||
libxslt1.1 \
|
||||
# uwsgi
|
||||
libpcre3 \
|
||||
libxml2 \
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user