summaryrefslogtreecommitdiff
path: root/searx/search.py
diff options
context:
space:
mode:
authorThomas Pointhuber <thomas.pointhuber@gmx.at>2015-08-24 11:18:58 +0200
committerThomas Pointhuber <thomas.pointhuber@gmx.at>2015-08-24 11:18:58 +0200
commit5bffa9ca33f8ec98baebca13ee9b16262bfe4e8d (patch)
tree5a9b0184fe4b20eb836dcea55095299c39361462 /searx/search.py
parent9cec9770be27cf4fc47d1caa2bccc59d911c20c2 (diff)
downloadsearxng-5bffa9ca33f8ec98baebca13ee9b16262bfe4e8d.tar.gz
searxng-5bffa9ca33f8ec98baebca13ee9b16262bfe4e8d.zip
[fix] rewrite scheme to http if there is no one, FIX #390
Diffstat (limited to 'searx/search.py')
-rw-r--r--searx/search.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/searx/search.py b/searx/search.py
index 6288a46eb..1bf05f7f9 100644
--- a/searx/search.py
+++ b/searx/search.py
@@ -206,6 +206,10 @@ def score_results(results):
# if there is no duplicate found, append result
else:
res['score'] = score
+ # if the result has no scheme, use http as default
+ if res['parsed_url'].scheme == '':
+ res['parsed_url'] = res['parsed_url']._replace(scheme="http")
+
results.append(res)
results = sorted(results, key=itemgetter('score'), reverse=True)