summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2021-06-26 17:14:13 +0200
committerMarkus Heiser <markus.heiser@darmarit.de>2021-06-26 17:14:13 +0200
commit6787e5a36b5251093bdd5a4734d1b870751f6398 (patch)
treea7edb372d1468bd5b42d4d371b916cced9e6fc33 /searx
parent4b60c557a943622ad22bf819b1c81f7725830b99 (diff)
downloadsearxng-6787e5a36b5251093bdd5a4734d1b870751f6398.tar.gz
searxng-6787e5a36b5251093bdd5a4734d1b870751f6398.zip
[fix] decoding of saved preferences in the URL
To compress saved preferences in the URL was introduced in 5f758b2d3 and slightly fixed in 8f4401462. But the main fail was not fixed; The decompress function returns a binary string and this binary should first be decoded to a string before it is passed to urllib.parse_qs. BTW: revert the hot-fix from 5973491 Related-to: https://github.com/searxng/searxng/issues/166 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx')
-rw-r--r--searx/preferences.py6
-rw-r--r--searx/settings.yml2
2 files changed, 4 insertions, 4 deletions
diff --git a/searx/preferences.py b/searx/preferences.py
index 46ce53ab3..b63bd446b 100644
--- a/searx/preferences.py
+++ b/searx/preferences.py
@@ -437,10 +437,10 @@ class Preferences:
def parse_encoded_data(self, input_data):
"""parse (base64) preferences from request (``flask.request.form['preferences']``)"""
- decoded_data = decompress(urlsafe_b64decode(input_data.encode()))
+ bin_data = decompress(urlsafe_b64decode(input_data))
dict_data = {}
- for x, y in parse_qs(decoded_data).items():
- dict_data[x.decode()] = y[0].decode()
+ for x, y in parse_qs(bin_data.decode('ascii')).items():
+ dict_data[x] = y[0]
self.parse_dict(dict_data)
def parse_dict(self, input_data):
diff --git a/searx/settings.yml b/searx/settings.yml
index 38fae50d0..9de49a2c0 100644
--- a/searx/settings.yml
+++ b/searx/settings.yml
@@ -1456,7 +1456,7 @@ engines:
timeout: 5.0
disabled: true
- - name: slownik jezyka polskiego
+ - name: słownik języka polskiego
engine: sjp
shortcut: sjp
base_url: https://sjp.pwn.pl/