mirror of
https://github.com/searxng/searxng.git
synced 2024-11-15 14:41:57 +00:00
[fix] append http if no scheme is provided in xpath's extact_url
This solves a bug with Yahoo where some results don't specify a protocol.
This commit is contained in:
parent
283f6c9053
commit
343e555ee9
1 changed files with 1 additions and 1 deletions
|
@ -53,7 +53,7 @@ def extract_url(xpath_results, search_url):
|
||||||
if url.startswith('//'):
|
if url.startswith('//'):
|
||||||
# add http or https to this kind of url //example.com/
|
# add http or https to this kind of url //example.com/
|
||||||
parsed_search_url = urlparse(search_url)
|
parsed_search_url = urlparse(search_url)
|
||||||
url = u'{0}:{1}'.format(parsed_search_url.scheme, url)
|
url = u'{0}:{1}'.format(parsed_search_url.scheme or 'http', url)
|
||||||
elif url.startswith('/'):
|
elif url.startswith('/'):
|
||||||
# fix relative url to the search engine
|
# fix relative url to the search engine
|
||||||
url = urljoin(search_url, url)
|
url = urljoin(search_url, url)
|
||||||
|
|
Loading…
Reference in a new issue