mirror of
https://github.com/searxng/searxng.git
synced 2025-12-22 19:50:00 +00:00
[fix] decoding of saved preferences in the URL
To compress saved preferences in the URL was introduced in5f758b2d3and slightly fixed in8f4401462. 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 from5973491Related-to: https://github.com/searxng/searxng/issues/166 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user