Reland fuchsia_remote_debug_protocol allows open port on remote device (#66271)

This commit is contained in:
Satsuki Ueno
2020-09-22 12:17:05 -07:00
committed by GitHub
parent 82bd7cf894
commit bf41c78255
5 changed files with 254 additions and 67 deletions

View File

@@ -17,7 +17,10 @@ void validateAddress(String address) {
/// Returns true if `address` is a valid IPv6 address.
bool isIpV6Address(String address) {
try {
Uri.parseIPv6Address(address);
// parseIpv6Address fails if there's a zone ID. Since this is still a valid
// IP, remove any zone ID before parsing.
final List<String> addressParts = address.split('%');
Uri.parseIPv6Address(addressParts[0]);
return true;
} on FormatException {
return false;