diff options
author | Markus Heiser <markus.heiser@darmarIT.de> | 2022-01-10 11:51:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-10 11:51:45 +0100 |
commit | 6420322cd1a22da50d7af9c0bb1b17bd1f370777 (patch) | |
tree | 9479e1c22b739151b8d797eb1810520523c9753a /searx | |
parent | 79e0aa26456ed316bf8a12c57a8faa46bf5ac2cb (diff) | |
parent | b76a81582781ebb11134b68d8d5dae3d245f88cd (diff) | |
download | searxng-6420322cd1a22da50d7af9c0bb1b17bd1f370777.tar.gz searxng-6420322cd1a22da50d7af9c0bb1b17bd1f370777.zip |
Merge pull request #729 from k2s/fix-tokens
fix(security): filtered_engines were not correctly evaluating validate_token()
Diffstat (limited to 'searx')
-rwxr-xr-x | searx/webapp.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/searx/webapp.py b/searx/webapp.py index 46b838b77..3df9f2876 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -932,7 +932,7 @@ def preferences(): allowed_plugins = request.preferences.plugins.get_enabled() # stats for preferences page - filtered_engines = dict(filter(lambda kv: (kv[0], request.preferences.validate_token(kv[1])), engines.items())) + filtered_engines = dict(filter(lambda kv: request.preferences.validate_token(kv[1]), engines.items())) engines_by_category = {} @@ -1163,7 +1163,7 @@ def stats(): sort_order = request.args.get('sort', default='name', type=str) selected_engine_name = request.args.get('engine', default=None, type=str) - filtered_engines = dict(filter(lambda kv: (kv[0], request.preferences.validate_token(kv[1])), engines.items())) + filtered_engines = dict(filter(lambda kv: request.preferences.validate_token(kv[1]), engines.items())) if selected_engine_name: if selected_engine_name not in filtered_engines: selected_engine_name = None @@ -1210,7 +1210,7 @@ def stats(): @app.route('/stats/errors', methods=['GET']) def stats_errors(): - filtered_engines = dict(filter(lambda kv: (kv[0], request.preferences.validate_token(kv[1])), engines.items())) + filtered_engines = dict(filter(lambda kv: request.preferences.validate_token(kv[1]), engines.items())) result = get_engine_errors(filtered_engines) return jsonify(result) |