mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
net.urllib: fix ipv6 address parsing [ipv6]:port
closes #15309
This commit is contained in:
parent
657389446b
commit
f557acf76b
2 changed files with 7 additions and 6 deletions
|
@ -598,12 +598,11 @@ fn parse_host(host string) ?string {
|
|||
host3 := unescape(host[i..], .encode_host) or { return err.msg() }
|
||||
return host1 + host2 + host3
|
||||
}
|
||||
if idx := host.last_index(':') {
|
||||
colon_port = host[idx..i]
|
||||
if !valid_optional_port(colon_port) {
|
||||
return error(error_msg('parse_host: invalid port $colon_port after host ',
|
||||
''))
|
||||
}
|
||||
} else if i := host.last_index(':') {
|
||||
colon_port := host[i..]
|
||||
if !valid_optional_port(colon_port) {
|
||||
return error(error_msg('parse_host: invalid port $colon_port after host ',
|
||||
''))
|
||||
}
|
||||
}
|
||||
h := unescape(host, .encode_host) or { return err.msg() }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue