forked from Icycoide/searxng
Proxify most of images references
Create hash only when necessary
This commit is contained in:
parent
9154cf7930
commit
1d51512152
8 changed files with 11 additions and 11 deletions
|
@ -214,11 +214,11 @@ def image_proxify(url):
|
|||
if url.startswith('//'):
|
||||
url = 'https:' + url
|
||||
|
||||
h = hashlib.sha256(url + settings['server']['secret_key']).hexdigest()
|
||||
|
||||
if not settings['server'].get('image_proxy') and not request.cookies.get('image_proxy'):
|
||||
return url
|
||||
|
||||
h = hashlib.sha256(url + settings['server']['secret_key']).hexdigest()
|
||||
|
||||
return '{0}?{1}'.format(url_for('image_proxy'),
|
||||
urlencode(dict(url=url, h=h)))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue