on master help sign in
improve https rewriting
commit0616d26feb0f96b3d4fd6b2744ae0288c9fed96b authorThomas Pointhuber <thomas.pointhuber@gmx.at> dateSun 14 Sep 2014, 14:17 (12 years ago) parent6e6dbc1
2 files changed+7−2
searx/__init__.py+4−2 searx/webapp.py+3
searx/__init__.py+4−2
@@ -24,5 +24,7 @@ else:
2424with open(settings_path) as settings_yaml:
2525 settings = load(settings_yaml)
2626
27−# loade https rules
28−load_https_rules(https_rewrite_path)
27+# load https rules only if https rewrite is enabled
28+if settings.get('server', {}).get('https_rewrite'):
29+ # loade https rules
30+ load_https_rules(https_rewrite_path)
searx/webapp.py+3
@@ -247,6 +247,9 @@ def index():
247247 # set new url
248248 result['url'] = new_result_url
249249
250+ # target has matched, do not search over the other rules
251+ break
252+
250253 if search.request_data.get('format', 'html') == 'html':
251254 if 'content' in result:
252255 result['content'] = highlight_content(result['content'],