浏览代码

[mod] do not proxify images if image proxy is not set

Adam Tauber 8 年前
父节点
当前提交
6243639f01
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3
    3
      searx/webapp.py

+ 3
- 3
searx/webapp.py 查看文件

266
 
266
 
267
 def image_proxify(url):
267
 def image_proxify(url):
268
 
268
 
269
-    if settings.get('result_proxy'):
270
-        return proxify(url)
271
-
272
     if url.startswith('//'):
269
     if url.startswith('//'):
273
         url = 'https:' + url
270
         url = 'https:' + url
274
 
271
 
275
     if not request.preferences.get_value('image_proxy'):
272
     if not request.preferences.get_value('image_proxy'):
276
         return url
273
         return url
277
 
274
 
275
+    if settings.get('result_proxy'):
276
+        return proxify(url)
277
+
278
     h = hmac.new(settings['server']['secret_key'], url.encode('utf-8'), hashlib.sha256).hexdigest()
278
     h = hmac.new(settings['server']['secret_key'], url.encode('utf-8'), hashlib.sha256).hexdigest()
279
 
279
 
280
     return '{0}?{1}'.format(url_for('image_proxy'),
280
     return '{0}?{1}'.format(url_for('image_proxy'),