Skip to content

Commit a11d797

Browse files
authored
Merge pull request #128 from ColleSerre/master
http.get takes a uri as an argument but was served an unparsed string
2 parents 8b564a3 + db8bffd commit a11d797

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/src/utils/turn_web.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import 'package:http/http.dart' as http;
33

44
Future<Map> getTurnCredential(String host, int port) async {
55
var url = 'https://$host:$port/api/turn?service=turn&username=flutter-webrtc';
6-
final res = await http.get(url);
7-
if (res.statusCode == 200) {
8-
var data = json.decode(res.body);
9-
print('getTurnCredential:response => $data.');
10-
return data;
11-
}
12-
return {};
13-
}
6+
final res = await http.get(Uri.parse(url));
7+
if (res.statusCode == 200) {
8+
var data = json.decode(res.body);
9+
print('getTurnCredential:response => $data.');
10+
return data;
11+
}
12+
return {};
13+
}

0 commit comments

Comments
 (0)