summaryrefslogtreecommitdiff
path: root/searx/https_rewrite.py
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2014-06-24 16:30:04 +0200
committerAdam Tauber <asciimoo@gmail.com>2014-06-24 16:30:04 +0200
commit96c8b20a045f62205a3b9a03113086f0fcfbc579 (patch)
treeb544d925aaf847b71c998d7f7a610abe73aeb686 /searx/https_rewrite.py
parentb44643222f85764399a4eac72541783eb8c2868f (diff)
downloadsearxng-96c8b20a045f62205a3b9a03113086f0fcfbc579.tar.gz
searxng-96c8b20a045f62205a3b9a03113086f0fcfbc579.zip
[enh] https rewrite basics
Diffstat (limited to 'searx/https_rewrite.py')
-rw-r--r--searx/https_rewrite.py14
1 files changed, 14 insertions, 0 deletions
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/'),
+)