mirror of
https://github.com/foss42/apidash.git
synced 2025-07-03 23:05:32 +08:00
Update http_client_manager.dart
This commit is contained in:
@ -5,8 +5,8 @@ import 'package:http/io_client.dart';
|
||||
|
||||
http.Client createHttpClientWithNoSSL() {
|
||||
var ioClient = HttpClient()
|
||||
..badCertificateCallback =
|
||||
(X509Certificate cert, String host, int port) => true;
|
||||
..badCertificateCallback = (X509Certificate cert, String host, int port) =>
|
||||
true;
|
||||
return IOClient(ioClient);
|
||||
}
|
||||
|
||||
@ -22,12 +22,10 @@ class HttpClientManager {
|
||||
|
||||
HttpClientManager._internal();
|
||||
|
||||
http.Client createClient(
|
||||
String requestId, {
|
||||
bool noSSL = false,
|
||||
}) {
|
||||
final client =
|
||||
(noSSL && !kIsWeb) ? createHttpClientWithNoSSL() : http.Client();
|
||||
http.Client createClient(String requestId, {bool noSSL = false}) {
|
||||
final client = (noSSL && !kIsWeb)
|
||||
? createHttpClientWithNoSSL()
|
||||
: http.Client();
|
||||
_clients[requestId] = client;
|
||||
return client;
|
||||
}
|
||||
|
Reference in New Issue
Block a user