summaryrefslogtreecommitdiff
path: root/searx/utils.py
diff options
context:
space:
mode:
authordalf <alex@al-f.net>2015-01-17 21:54:40 +0100
committerdalf <alex@al-f.net>2015-01-17 21:54:40 +0100
commitb6d27aca590c034710544a982bca2b71abb878c5 (patch)
tree6e7a05a8f08304145364240abec493575a92fe44 /searx/utils.py
parenta865e6672fa2a289937ff378e8893c19f71c5e0c (diff)
downloadsearxng-b6d27aca590c034710544a982bca2b71abb878c5.tar.gz
searxng-b6d27aca590c034710544a982bca2b71abb878c5.zip
[enh] image-proxy : handle ETag and date related headers, add hash to URL
Diffstat (limited to 'searx/utils.py')
-rw-r--r--searx/utils.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/searx/utils.py b/searx/utils.py
index 0b4de9410..89128d506 100644
--- a/searx/utils.py
+++ b/searx/utils.py
@@ -206,3 +206,11 @@ def format_date_by_locale(date_string, locale_string):
except:
logger.warning('cannot set original locale: {0}'.format(orig_locale))
return formatted_date
+
+
+def dict_subset(d, properties):
+ result = {}
+ for k in properties:
+ if k in d:
+ result[k] = d[k]
+ return result