Fix validate url creation (#110)
This commit is contained in:
+3
-8
@@ -1,10 +1,9 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:math' as math;
|
import 'dart:math' as math;
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
|
||||||
|
|
||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
import 'package:device_info_plus/device_info_plus.dart';
|
import 'package:device_info_plus/device_info_plus.dart';
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter_webrtc/flutter_webrtc.dart' as rtc;
|
import 'package:flutter_webrtc/flutter_webrtc.dart' as rtc;
|
||||||
import 'package:meta/meta.dart';
|
import 'package:meta/meta.dart';
|
||||||
|
|
||||||
@@ -152,17 +151,13 @@ class Utils {
|
|||||||
final useSecure = uri.isSecureScheme || forceSecure;
|
final useSecure = uri.isSecureScheme || forceSecure;
|
||||||
final httpScheme = useSecure ? 'https' : 'http';
|
final httpScheme = useSecure ? 'https' : 'http';
|
||||||
final wsScheme = useSecure ? 'wss' : 'ws';
|
final wsScheme = useSecure ? 'wss' : 'ws';
|
||||||
final lastSegment = validate ? 'validate' : 'rtc';
|
final lastSegments = validate ? ['rtc', 'validate'] : ['rtc'];
|
||||||
|
|
||||||
final pathSegments = List<String>.from(uri.pathSegments);
|
final pathSegments = List<String>.from(uri.pathSegments);
|
||||||
|
|
||||||
// strip path segment used for LiveKit if already exists
|
// strip path segment used for LiveKit if already exists
|
||||||
pathSegments.removeWhere((e) => e.isEmpty);
|
pathSegments.removeWhere((e) => e.isEmpty);
|
||||||
if (pathSegments.isNotEmpty &&
|
pathSegments.addAll(lastSegments);
|
||||||
['rtc', 'validate'].contains(uri.pathSegments.last)) {
|
|
||||||
pathSegments.removeLast();
|
|
||||||
}
|
|
||||||
pathSegments.add(lastSegment);
|
|
||||||
|
|
||||||
final clientInfo = await _clientInfo();
|
final clientInfo = await _clientInfo();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user