Prune some duplicated dependencies in the dep graph (#11433)

Signed-off-by: koushiro <koushiro.cqx@gmail.com>
This commit is contained in:
Qinxuan Chen
2022-05-18 15:23:15 +08:00
committed by GitHub
parent 74428fa8ac
commit fe4acb7924
11 changed files with 36 additions and 146 deletions
+8 -2
View File
@@ -32,7 +32,7 @@ use bytes::buf::{Buf, Reader};
use fnv::FnvHashMap;
use futures::{channel::mpsc, future, prelude::*};
use hyper::{client, Body, Client as HyperClient};
use hyper_rustls::HttpsConnector;
use hyper_rustls::{HttpsConnector, HttpsConnectorBuilder};
use once_cell::sync::Lazy;
use sc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender};
use sp_core::offchain::{HttpError, HttpRequestId, HttpRequestStatus, Timestamp};
@@ -53,7 +53,13 @@ pub struct SharedClient(Arc<Lazy<HyperClient<HttpsConnector<client::HttpConnecto
impl SharedClient {
pub fn new() -> Self {
Self(Arc::new(Lazy::new(|| {
HyperClient::builder().build(HttpsConnector::with_native_roots())
let connector = HttpsConnectorBuilder::new()
.with_native_roots()
.https_or_http()
.enable_http1()
.enable_http2()
.build();
HyperClient::builder().build(connector)
})))
}
}