Don't treat "Hello." as URL with auto-search=naive

This commit is contained in:
Florian Bruhin 2016-08-23 09:02:39 +02:00
parent f45c4d73f4
commit a17b8bec90
2 changed files with 3 additions and 1 deletions

View File

@ -127,7 +127,8 @@ def _is_url_naive(urlstr):
if not QHostAddress(urlstr).isNull():
return False
return '.' in url.host()
host = url.host()
return '.' in host and not host.endswith('.')
def _is_url_dns(urlstr):

View File

@ -336,6 +336,7 @@ def test_get_search_url_invalid(urlutils_config_stub, url):
(False, True, False, '23.42'), # no DNS because bogus-IP
(False, True, False, '1337'), # no DNS because bogus-IP
(False, True, True, 'deadbeef'),
(False, True, True, 'hello.'),
# no DNS because bogus-IP
pytest.mark.xfail(qtutils.version_check('5.6.1'),
reason='Qt behavior changed')(