diff options
| author | Adam Tauber <asciimoo@gmail.com> | 2016-10-17 01:32:31 +0200 |
|---|---|---|
| committer | Adam Tauber <asciimoo@gmail.com> | 2016-10-17 01:32:31 +0200 |
| commit | d5c0dcd18a04940f3ac0552f98f812fd005ae8d1 (patch) | |
| tree | 4a6a4c04048e9a2a1332cf9b6b4f108e1b771e6c /searx/webapp.py | |
| parent | 1be6e72d517c1651fc466d3222a23dbda0a53c2c (diff) | |
[fix] unicode url proxiing
Diffstat (limited to 'searx/webapp.py')
| -rw-r--r-- | searx/webapp.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/searx/webapp.py b/searx/webapp.py index b8d79b56c..6c2b98c9c 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -250,7 +250,7 @@ def proxify(url): if not settings.get('result_proxy'): return url - h = hmac.new(settings['result_proxy']['key'], url, hashlib.sha256).hexdigest() + h = hmac.new(settings['result_proxy']['key'], url.encode('utf-8'), hashlib.sha256).hexdigest() return '{0}?{1}'.format(settings['result_proxy']['url'], urlencode(dict(mortyurl=url.encode('utf-8'), @@ -265,7 +265,7 @@ def image_proxify(url): if not request.preferences.get_value('image_proxy'): return url - h = hmac.new(settings['server']['secret_key'], url, hashlib.sha256).hexdigest() + h = hmac.new(settings['server']['secret_key'], url.encode('utf-8'), hashlib.sha256).hexdigest() return '{0}?{1}'.format(url_for('image_proxy'), urlencode(dict(url=url.encode('utf-8'), h=h))) |