Browse Source

[fix] produce valid urls if scheme is missing

Adam Tauber 7 years ago
parent
commit
1972a044a3
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      searx/engines/xpath.py

+ 1
- 1
searx/engines/xpath.py View File

53
     if url.startswith('//'):
53
     if url.startswith('//'):
54
         # add http or https to this kind of url //example.com/
54
         # add http or https to this kind of url //example.com/
55
         parsed_search_url = urlparse(search_url)
55
         parsed_search_url = urlparse(search_url)
56
-        url = parsed_search_url.scheme + url
56
+        url = u'{0}:{1}'.format(parsed_search_url.scheme, url)
57
     elif url.startswith('/'):
57
     elif url.startswith('/'):
58
         # fix relative url to the search engine
58
         # fix relative url to the search engine
59
         url = urljoin(search_url, url)
59
         url = urljoin(search_url, url)