on master help sign in
[fix] unicode url proxiing
commitd5c0dcd18a04940f3ac0552f98f812fd005ae8d1 authorAdam Tauber <asciimoo@gmail.com> dateMon 17 Oct 2016, 01:32 (10 years ago) parent1be6e72
1 file changed+2−2
searx/webapp.py+2−2
searx/webapp.py+2−2
@@ -250,7 +250,7 @@ def proxify(url):
250250 if not settings.get('result_proxy'):
251251 return url
252252
253− h = hmac.new(settings['result_proxy']['key'], url, hashlib.sha256).hexdigest()
253+ h = hmac.new(settings['result_proxy']['key'], url.encode('utf-8'), hashlib.sha256).hexdigest()
254254
255255 return '{0}?{1}'.format(settings['result_proxy']['url'],
256256 urlencode(dict(mortyurl=url.encode('utf-8'),
@@ -265,7 +265,7 @@ def image_proxify(url):
265265 if not request.preferences.get_value('image_proxy'):
266266 return url
267267
268− h = hmac.new(settings['server']['secret_key'], url, hashlib.sha256).hexdigest()
268+ h = hmac.new(settings['server']['secret_key'], url.encode('utf-8'), hashlib.sha256).hexdigest()
269269
270270 return '{0}?{1}'.format(url_for('image_proxy'),
271271 urlencode(dict(url=url.encode('utf-8'), h=h)))