Revert "Sanitize host before calling pm (#49591)" (#49623)

This reverts commit c592b54678.
This commit is contained in:
Jonah Williams
2020-01-28 10:14:08 -08:00
committed by GitHub
parent c592b54678
commit 3bd4c69fd8
4 changed files with 6 additions and 99 deletions

View File

@@ -27,7 +27,6 @@ import 'application_package.dart';
import 'fuchsia_build.dart';
import 'fuchsia_pm.dart';
import 'fuchsia_sdk.dart';
import 'fuchsia_utils.dart';
import 'fuchsia_workflow.dart';
import 'tiles_ctl.dart';
@@ -514,7 +513,12 @@ class FuchsiaDevice extends Device {
void clearLogs() {}
bool get ipv6 {
return isIPv6Address(id);
try {
Uri.parseIPv6Address(id);
return true;
} on FormatException {
return false;
}
}
/// List the ports currently running a dart observatory.

View File

@@ -10,7 +10,6 @@ import '../convert.dart';
import '../globals.dart' as globals;
import 'fuchsia_sdk.dart';
import 'fuchsia_utils.dart';
/// This is a basic wrapper class for the Fuchsia SDK's `pm` tool.
class FuchsiaPM {
@@ -110,9 +109,6 @@ class FuchsiaPM {
if (fuchsiaArtifacts.pm == null) {
throwToolExit('Fuchsia pm tool not found');
}
if (isIPv6Address(host.split('%').first)) {
host = '[${host.replaceAll('%', '%25')}]';
}
final List<String> command = <String>[
fuchsiaArtifacts.pm.path,
'serve',

View File

@@ -1,13 +0,0 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// Returns [true] if [address] is an IPv6 address.
bool isIPv6Address(String address) {
try {
Uri.parseIPv6Address(address);
return true;
} on FormatException {
return false;
}
}