From b6d27aca590c034710544a982bca2b71abb878c5 Mon Sep 17 00:00:00 2001 From: dalf Date: Sat, 17 Jan 2015 21:54:40 +0100 Subject: [enh] image-proxy : handle ETag and date related headers, add hash to URL --- searx/utils.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'searx/utils.py') 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 -- cgit v1.2.3