From 96c8b20a045f62205a3b9a03113086f0fcfbc579 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Tue, 24 Jun 2014 16:30:04 +0200 Subject: [enh] https rewrite basics --- searx/https_rewrite.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 searx/https_rewrite.py (limited to 'searx/https_rewrite.py') diff --git a/searx/https_rewrite.py b/searx/https_rewrite.py new file mode 100644 index 000000000..44ada9450 --- /dev/null +++ b/searx/https_rewrite.py @@ -0,0 +1,14 @@ +import re + +# https://gitweb.torproject.org/\ +# pde/https-everywhere.git/tree/4.0:/src/chrome/content/rules + +# HTTPS rewrite rules +https_rules = ( + # from + (re.compile(r'^http://(www\.|m\.|)?xkcd\.(?:com|org)/', re.I | re.U), + # to + r'https://\1xkcd.com/'), + (re.compile(r'^https?://(?:ssl)?imgs\.xkcd\.com/', re.I | re.U), + r'https://sslimgs.xkcd.com/'), +) -- cgit v1.2.3