on master help sign in
[fix] rewrite scheme to http if there is no one, FIX #390
commit5bffa9ca33f8ec98baebca13ee9b16262bfe4e8d authorThomas Pointhuber <thomas.pointhuber@gmx.at> dateMon 24 Aug 2015, 11:18 (11 years ago) parent9cec977
1 file changed+4
searx/search.py+4
searx/search.py+4
@@ -206,6 +206,10 @@ def score_results(results):
206206 # if there is no duplicate found, append result
207207 else:
208208 res['score'] = score
209+ # if the result has no scheme, use http as default
210+ if res['parsed_url'].scheme == '':
211+ res['parsed_url'] = res['parsed_url']._replace(scheme="http")
212+
209213 results.append(res)
210214
211215 results = sorted(results, key=itemgetter('score'), reverse=True)