Unverified Commit c5554cdf authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

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

parent de8cf8b5
......@@ -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';
......
......@@ -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',
);
});
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment