Commits
Click on a commit to change the comparison range:bug: Raise `ValueError` exception when IPv6 URL is empty or brackets reversed
Problem: If brackets are reversed or content inside brackets is empty,
`bracketed_host` will be an empty string. In consequence, reaching the
first element of `bracketed_host` returns an `IndexError`.
Solution: Use `startswith` because it does not raise anything if the string is empty
and then it fallbacks into the following check verifying the presence of `:`.
Also, the raised message was made more generic but still keeps its meaning.