Check for spaces in URLs with explicit scheme

Fixes #1954
This commit is contained in:
Florian Bruhin 2016-09-15 22:29:21 +02:00
parent 8b7c457802
commit e5b3880b71
2 changed files with 2 additions and 1 deletions

View File

@ -212,7 +212,7 @@ def _has_explicit_scheme(url):
# symbols, we treat this as not a URI anyways.
return (url.isValid() and url.scheme() and
(url.host() or url.path()) and
not url.path().startswith(' ') and
' ' not in url.path() and
not url.path().startswith(':'))

View File

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