summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2015-02-09 12:24:54 +0100
committerAdam Tauber <asciimoo@gmail.com>2015-02-09 12:24:54 +0100
commitc711212662996e232a1d3bc692f6f765e1467125 (patch)
tree6eb8cba5ddc7e48c36fdbcee41cd171b6d691c6e /searx
parent67df3c516fc380d000f32d43ecb90c0fc32ca46a (diff)
[fix] image proxify utf urls
Diffstat (limited to 'searx')
-rw-r--r--searx/webapp.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index 861f3aa29..fbfb9ff2a 100644
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -215,15 +215,14 @@ def image_proxify(url):
if url.startswith('//'):
url = 'https:' + url
- url = url.encode('utf-8')
-
if not settings['server'].get('image_proxy') and not request.cookies.get('image_proxy'):
return url
- h = hashlib.sha256(url + settings['server']['secret_key'].encode('utf-8')).hexdigest()
+ hash_string = url + settings['server']['secret_key']
+ h = hashlib.sha256(hash_string.encode('utf-8')).hexdigest()
return '{0}?{1}'.format(url_for('image_proxy'),
- urlencode(dict(url=url, h=h)))
+ urlencode(dict(url=url.encode('utf-8'), h=h)))
def render(template_name, override_theme=None, **kwargs):