Skip to content

Commit a009d71

Browse files
authored
Updated flutter_driver to support auth codes (flutter#31310)
1 parent 3764cb8 commit a009d71

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/flutter_driver/lib/src/driver/driver.dart

+7-1
Original file line numberDiff line numberDiff line change
@@ -937,8 +937,14 @@ void restoreVmServiceConnectFunction() {
937937
/// the [VMServiceClient].
938938
Future<VMServiceClientConnection> _waitAndConnect(String url) async {
939939
Uri uri = Uri.parse(url);
940+
final List<String> pathSegments = <String>[];
941+
// If there's an authentication code (default), we need to add it to our path.
942+
if (uri.pathSegments.isNotEmpty) {
943+
pathSegments.add(uri.pathSegments.first);
944+
}
945+
pathSegments.add('ws');
940946
if (uri.scheme == 'http')
941-
uri = uri.replace(scheme: 'ws', path: '/ws');
947+
uri = uri.replace(scheme: 'ws', pathSegments: pathSegments);
942948
int attempts = 0;
943949
while (true) {
944950
WebSocket ws1;

0 commit comments

Comments
 (0)