Updated flutter_driver to support auth codes (#31310)

This commit is contained in:
Ben Konyi 2019-04-19 07:57:04 -07:00 committed by GitHub
parent 3764cb8515
commit a009d71101
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -937,8 +937,14 @@ void restoreVmServiceConnectFunction() {
/// the [VMServiceClient].
Future<VMServiceClientConnection> _waitAndConnect(String url) async {
Uri uri = Uri.parse(url);
final List<String> pathSegments = <String>[];
// If there's an authentication code (default), we need to add it to our path.
if (uri.pathSegments.isNotEmpty) {
pathSegments.add(uri.pathSegments.first);
}
pathSegments.add('ws');
if (uri.scheme == 'http')
uri = uri.replace(scheme: 'ws', path: '/ws');
uri = uri.replace(scheme: 'ws', pathSegments: pathSegments);
int attempts = 0;
while (true) {
WebSocket ws1;