Handle :// as URL pattern
This commit is contained in:
parent
5f10c9c15f
commit
67b4b7d490
@ -65,6 +65,7 @@ Fixed
|
|||||||
Note it still does not work on Qt 5.10 (due to a Qt bug) and Qt < 5.9.2.
|
Note it still does not work on Qt 5.10 (due to a Qt bug) and Qt < 5.9.2.
|
||||||
- Repeated escaping of entries in `qute://log` when refreshing page.
|
- Repeated escaping of entries in `qute://log` when refreshing page.
|
||||||
- The host blocker doesn't block 0.0.0.0 anymore.
|
- The host blocker doesn't block 0.0.0.0 anymore.
|
||||||
|
- Crash when using :// as URL pattern
|
||||||
|
|
||||||
v1.4.1
|
v1.4.1
|
||||||
------
|
------
|
||||||
|
@ -142,7 +142,9 @@ class UrlPattern:
|
|||||||
Deviation from Chromium:
|
Deviation from Chromium:
|
||||||
- We assume * when no scheme has been given.
|
- We assume * when no scheme has been given.
|
||||||
"""
|
"""
|
||||||
assert parsed.scheme, parsed
|
if not parsed.scheme:
|
||||||
|
raise ParseError("Missing scheme")
|
||||||
|
|
||||||
if parsed.scheme == 'any':
|
if parsed.scheme == 'any':
|
||||||
self._scheme = None
|
self._scheme = None
|
||||||
return
|
return
|
||||||
|
@ -96,7 +96,7 @@ from qutebrowser.utils import urlmatch
|
|||||||
("http://[fc2e:bb88:edac]", 'Invalid IPv6 address; source was "fc2e:bb88:edac"; host = ""'),
|
("http://[fc2e:bb88:edac]", 'Invalid IPv6 address; source was "fc2e:bb88:edac"; host = ""'),
|
||||||
("http://[fc2e:bb88:edac::z]", 'Invalid IPv6 address; source was "fc2e:bb88:edac::z"; host = ""'),
|
("http://[fc2e:bb88:edac::z]", 'Invalid IPv6 address; source was "fc2e:bb88:edac::z"; host = ""'),
|
||||||
("http://[fc2e:bb88:edac::2]:2a2", "Invalid port: invalid literal for int() with base 10: '2a2'"),
|
("http://[fc2e:bb88:edac::2]:2a2", "Invalid port: invalid literal for int() with base 10: '2a2'"),
|
||||||
|
("://", "Missing scheme"),
|
||||||
])
|
])
|
||||||
def test_invalid_patterns(pattern, error):
|
def test_invalid_patterns(pattern, error):
|
||||||
with pytest.raises(urlmatch.ParseError, match=re.escape(error)):
|
with pytest.raises(urlmatch.ParseError, match=re.escape(error)):
|
||||||
|
Loading…
Reference in New Issue
Block a user