[flutter_tools] detect ipv6 in fuchsia server url (#55605)
This commit is contained in:
@@ -192,7 +192,7 @@ class FuchsiaPackageServer {
|
||||
Process _process;
|
||||
|
||||
/// The URL that can be used by the device to access this package server.
|
||||
String get url => 'http://$_host:$_port';
|
||||
String get url => Uri(scheme: 'http', host: _host, port: _port).toString();
|
||||
|
||||
// The name used to reference the server by fuchsia-pkg:// urls.
|
||||
final String name;
|
||||
|
||||
@@ -71,6 +71,16 @@ void main() {
|
||||
FuchsiaArtifacts: () => mockFuchsiaArtifacts,
|
||||
ProcessManager: () => mockProcessManager,
|
||||
});
|
||||
|
||||
testWithoutContext('ipv6 formatting logic of FuchsiaPackageServer', () {
|
||||
const String host = 'fe80::ec4:7aff:fecc:ea8f%eno2';
|
||||
const int port = 23;
|
||||
|
||||
expect(
|
||||
FuchsiaPackageServer('a', 'b', host, port).url,
|
||||
'http://[fe80::ec4:7aff:fecc:ea8f%25eno2]:23',
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user