mirror of
https://github.com/foss42/apidash.git
synced 2025-07-03 14:36:22 +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() {
|
http.Client createHttpClientWithNoSSL() {
|
||||||
var ioClient = HttpClient()
|
var ioClient = HttpClient()
|
||||||
..badCertificateCallback =
|
..badCertificateCallback = (X509Certificate cert, String host, int port) =>
|
||||||
(X509Certificate cert, String host, int port) => true;
|
true;
|
||||||
return IOClient(ioClient);
|
return IOClient(ioClient);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -22,12 +22,10 @@ class HttpClientManager {
|
|||||||
|
|
||||||
HttpClientManager._internal();
|
HttpClientManager._internal();
|
||||||
|
|
||||||
http.Client createClient(
|
http.Client createClient(String requestId, {bool noSSL = false}) {
|
||||||
String requestId, {
|
final client = (noSSL && !kIsWeb)
|
||||||
bool noSSL = false,
|
? createHttpClientWithNoSSL()
|
||||||
}) {
|
: http.Client();
|
||||||
final client =
|
|
||||||
(noSSL && !kIsWeb) ? createHttpClientWithNoSSL() : http.Client();
|
|
||||||
_clients[requestId] = client;
|
_clients[requestId] = client;
|
||||||
return client;
|
return client;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user