summaryrefslogtreecommitdiff
path: root/docs/dev/result_types
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarIT.de>2026-05-25 18:12:40 +0200
committerGitHub <noreply@github.com>2026-05-25 18:12:40 +0200
commit28ef4f7447debd6f988963c80b3ad15046c65908 (patch)
tree79b3068b5846c5f104c1eb5e5a66c73e50a3c605 /docs/dev/result_types
parentcb4b70ac500889bd0aeccebb35847d91b5a531f8 (diff)
[mod] hardening of the Result.filter_urls() method (#6117)
Exceptions in the execution of the callback must be caught / ignored and logged on the ERROR log. To test, apply this patch to provoke a ValueError exception:: diff --git a/searx/data/tracker_patterns.py b/searx/data/tracker_patterns.py index ed4415bce..695ed05d2 100644 --- a/searx/data/tracker_patterns.py +++ b/searx/data/tracker_patterns.py @@ -114,6 +114,7 @@ class TrackerPatternsDB: Returns bool ``True`` to use URL unchanged (``False`` to ignore URL). If URL should be modified, the returned string is the new URL to use. """ + raise ValueError("test callback exceptions") new_url = url parsed_new_url = urlparse(url=new_url) Start a `make run` instance and query for example `amazon` .. have a look at the ERROR log: ERROR searx.result_types: filter_urls (field 'url'): ignore ValueError('test callback exceptions') from callback searx/data/tracker_patterns.py:117 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'docs/dev/result_types')
0 files changed, 0 insertions, 0 deletions