[flutter_tools] remove trailing eth info from fuchsia package server (#55617)

This commit is contained in:
Jonah Williams 2020-04-24 21:35:23 -07:00 committed by GitHub
parent de8cf8b530
commit c5554cdf41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -180,7 +180,17 @@ class FuchsiaPM {
/// server.stop();
/// }
class FuchsiaPackageServer {
FuchsiaPackageServer(this._repo, this.name, this._host, this._port);
factory FuchsiaPackageServer(String repo, String name, String host, int port) {
// TODO(jonahwilliams): ensure we only receive valid ipv4 or ipv6 InternetAddresses.
// Temporary work around to receiving ipv6 addresses with trailing information:
// fe80::ec4:7aff:fecc:ea8f%eno2
if (host.contains('%')) {
host = host.split('%').first;
}
return FuchsiaPackageServer._(repo, name, host, port);
}
FuchsiaPackageServer._(this._repo, this.name, this._host, this._port);
static const String deviceHost = 'fuchsia.com';
static const String toolHost = 'flutter_tool';

View File

@ -78,7 +78,7 @@ void main() {
expect(
FuchsiaPackageServer('a', 'b', host, port).url,
'http://[fe80::ec4:7aff:fecc:ea8f%25eno2]:23',
'http://[fe80::ec4:7aff:fecc:ea8f]:23',
);
});
});