mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-04 21:05:11 +00:00
interface: hostname cannot be empty
This commit is contained in:
parent
916cdebacb
commit
adc91eb75e
1 changed files with 2 additions and 1 deletions
|
@ -115,10 +115,11 @@ class ErrorParsingSSLCert(Exception): pass
|
|||
class ErrorGettingSSLCertFromServer(Exception): pass
|
||||
|
||||
|
||||
|
||||
def deserialize_server(server_str: str) -> Tuple[str, str, str]:
|
||||
# host might be IPv6 address, hence do rsplit:
|
||||
host, port, protocol = str(server_str).rsplit(':', 2)
|
||||
if not host:
|
||||
raise ValueError('host must not be empty')
|
||||
if protocol not in ('s', 't'):
|
||||
raise ValueError('invalid network protocol: {}'.format(protocol))
|
||||
int(port) # Throw if cannot be converted to int
|
||||
|
|
Loading…
Add table
Reference in a new issue