mirror of
https://github.com/searxng/searxng
synced 2024-01-01 18:24:07 +00:00
[fix] produce valid urls if scheme is missing
This commit is contained in:
parent
8db527c1d2
commit
1972a044a3
@ -53,7 +53,7 @@ def extract_url(xpath_results, search_url):
|
||||
if url.startswith('//'):
|
||||
# add http or https to this kind of url //example.com/
|
||||
parsed_search_url = urlparse(search_url)
|
||||
url = parsed_search_url.scheme + url
|
||||
url = u'{0}:{1}'.format(parsed_search_url.scheme, url)
|
||||
elif url.startswith('/'):
|
||||
# fix relative url to the search engine
|
||||
url = urljoin(search_url, url)
|
||||
|
Loading…
Reference in New Issue
Block a user