Browse Source

[fix] rewrite scheme to http if there is no one, FIX #390

Thomas Pointhuber 9 years ago
parent
commit
5bffa9ca33
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      searx/search.py

+ 4
- 0
searx/search.py View File

@@ -206,6 +206,10 @@ def score_results(results):
206 206
         # if there is no duplicate found, append result
207 207
         else:
208 208
             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
+
209 213
             results.append(res)
210 214
 
211 215
     results = sorted(results, key=itemgetter('score'), reverse=True)