Commit 33e61d1c authored by Jonah Williams's avatar Jonah Williams Committed by Flutter GitHub Bot

[flutter_tools] open chrome with unresolve hostname (#49625)

parent 6f0136cc
...@@ -340,10 +340,7 @@ class WebFs { ...@@ -340,10 +340,7 @@ class WebFs {
client, client,
server, server,
dwds, dwds,
// Format ipv6 hosts according to RFC 5952. 'http://$effectiveHostname:$hostPort',
internetAddress.type == InternetAddressType.IPv4
? 'http://${internetAddress.address}:$hostPort'
: 'http://[${internetAddress.address}]:$hostPort',
assetServer, assetServer,
buildInfo.isDebug, buildInfo.isDebug,
flutterProject, flutterProject,
......
...@@ -276,13 +276,7 @@ class WebDevFS implements DevFS { ...@@ -276,13 +276,7 @@ class WebDevFS implements DevFS {
@override @override
Future<Uri> create() async { Future<Uri> create() async {
_webAssetServer = await WebAssetServer.start(hostname, port); _webAssetServer = await WebAssetServer.start(hostname, port);
final InternetAddress internetAddress = _webAssetServer.internetAddress; return Uri.parse('http://$hostname:$port');
// Format ipv6 hosts according to RFC 5952.
return Uri.parse(
internetAddress.type == InternetAddressType.IPv4
? 'http://${internetAddress.address}:$port'
: 'http://[${internetAddress.address}]:$port'
);
} }
@override @override
......
...@@ -181,10 +181,7 @@ void main() { ...@@ -181,10 +181,7 @@ void main() {
dartDefines: const <String>[], dartDefines: const <String>[],
); );
// Might be either ipv4 or ipv6 for localhost. expect(webFs.uri.toString(), contains('localhost'));
final bool hasExpectedUri = webFs.uri.toString().contains('[::1]:1234') ||
webFs.uri.toString().contains('127.0.0.1:1234');
expect(hasExpectedUri, true);
expect(lastPort, 1234); expect(lastPort, 1234);
})); }));
......
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