summaryrefslogtreecommitdiff
path: root/searx/webapp.py
diff options
context:
space:
mode:
authorThomas Pointhuber <thomas.pointhuber@gmx.at>2014-10-15 14:47:03 +0200
committerThomas Pointhuber <thomas.pointhuber@gmx.at>2014-10-15 14:47:03 +0200
commitbb126da0fb49d1c9640eeb3371d0bbcf005bcd2b (patch)
treeeeb44287d1d67059bc296c3ff6a59ece8ce2ce01 /searx/webapp.py
parent0616d26feb0f96b3d4fd6b2744ae0288c9fed96b (diff)
improve https rewrite code
Diffstat (limited to 'searx/webapp.py')
-rw-r--r--searx/webapp.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index d9dc5f710..25c99d94c 100644
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -224,10 +224,14 @@ def index():
# process rules
for rule in rules:
- # TODO, precompile rule
- p = re.compile(rule[0])
- # rewrite url if possible
- new_result_url = p.sub(rule[1], result['url'])
+ try:
+ # TODO, precompile rule
+ p = re.compile(rule[0])
+
+ # rewrite url if possible
+ new_result_url = p.sub(rule[1], result['url'])
+ except:
+ break
# parse new url
new_parsed_url = urlparse(new_result_url)