mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[flutter_tools] remove trailing eth info from fuchsia package server (#55617)
This commit is contained in:
parent
de8cf8b530
commit
c5554cdf41
@ -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',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user