changing suggested flaws
This commit is contained in:
parent
484a22f111
commit
972b3ae960
@ -183,8 +183,8 @@ class UrlPattern:
|
||||
# Using QUrl parsing to minimize ipv6 addresses
|
||||
url = QUrl()
|
||||
url.setHost("[" + parsed.hostname + "]")
|
||||
if url.host() == "":
|
||||
raise ParseError("Invalid IPv6 URL"+parsed.hostname)
|
||||
if not url.isValid():
|
||||
raise ParseError(url.errorString())
|
||||
self._host = url.host()
|
||||
return
|
||||
|
||||
|
@ -85,16 +85,17 @@ from qutebrowser.utils import urlmatch
|
||||
# Additional tests
|
||||
("http://[", "Invalid IPv6 URL"),
|
||||
("http://[fc2e:bb88::edac]:", "Invalid port: Port is empty"),
|
||||
("http://[fc2e::bb88::edac]", "Invalid IPv6 URL"),
|
||||
("http://[fc2e:0e35:bb88::edac:fc2e:0e35:bb88:edac]", "Invalid IPv6 URL"),
|
||||
("http://[fc2e:0e35:bb88:af:edac:fc2e:0e35:bb88:edac]", "Invalid IPv6 URL"),
|
||||
("http://[127.0.0.1:fc2e::bb88:edac]", "Invalid IPv6 URL"),
|
||||
("http://[fc2e::bb88::edac]", """Invalid IPv6 address (character ':' not permitted); source was "[fc2e::bb88::edac]"; host = """""),
|
||||
("http://[fc2e:0e35:bb88::edac:fc2e:0e35:bb88:edac]", 'Invalid IPv6 address; source was "[fc2e:0e35:bb88::edac:fc2e:0e35:bb88:edac]"; host = ""'),
|
||||
("http://[fc2e:0e35:bb88:af:edac:fc2e:0e35:bb88:edac]", 'Invalid IPv6 address; source was "[fc2e:0e35:bb88:af:edac:fc2e:0e35:bb88:edac]"; host = ""'),
|
||||
("http://[127.0.0.1:fc2e::bb88:edac]", """Invalid IPv6 address (character '1' not permitted); source was "[127.0.0.1:fc2e::bb88:edac]"; host = """""),
|
||||
("http://[]:20", "Pattern without host"),
|
||||
("http://[fc2e::bb88", "Invalid IPv6 URL"),
|
||||
("http://[[fc2e::bb88:edac]", "Invalid IPv6 URL"),
|
||||
("http://[fc2e::bb88:edac]]", "Invalid IPv6 URL"),
|
||||
("http://[fc2e:bb88:edac]", "Invalid IPv6 URL"),
|
||||
("http://[fc2e:bb88:edac::z]", "Invalid IPv6 URL"),
|
||||
("http://[[fc2e::bb88:edac]", """Invalid IPv6 address (character '[' not permitted); source was "[[fc2e::bb88:edac]"; host = """""),
|
||||
pytest.param("http://[fc2e::bb88:edac]]", "Invalid IPv6 URL", marks=pytest.mark.xfail(
|
||||
reason="https://bugs.python.org/issue34360")),
|
||||
("http://[fc2e:bb88:edac]", 'Invalid IPv6 address; source was "[fc2e:bb88:edac]"; host = ""'),
|
||||
("http://[fc2e:bb88:edac::z]", """Invalid IPv6 address (character 'z' not permitted); source was "[fc2e:bb88:edac::z]"; host = """""),
|
||||
("http://[fc2e:bb88:edac::2]:2a2", "Invalid port: invalid literal for int() with base 10: '2a2'"),
|
||||
|
||||
])
|
||||
|
Loading…
Reference in New Issue
Block a user