Add blanket HttpClient impl for hyper::Client
This commit is contained in:
parent
1aa770c2de
commit
fc708c325d
10
src/lib.rs
10
src/lib.rs
|
@ -8,6 +8,7 @@ use std::fmt;
|
|||
use std::sync::Arc;
|
||||
|
||||
use base64::prelude::{Engine, BASE64_URL_SAFE_NO_PAD};
|
||||
use hyper::client::connect::Connect;
|
||||
#[cfg(feature = "hyper-rustls")]
|
||||
use hyper::client::HttpConnector;
|
||||
use hyper::client::ResponseFuture;
|
||||
|
@ -625,5 +626,14 @@ pub trait HttpClient {
|
|||
fn request(&self, req: Request<Body>) -> ResponseFuture;
|
||||
}
|
||||
|
||||
impl<C> HttpClient for hyper::Client<C>
|
||||
where
|
||||
C: Connect + Clone + Send + Sync + 'static,
|
||||
{
|
||||
fn request(&self, req: Request<Body>) -> ResponseFuture {
|
||||
<hyper::Client<C>>::request(self, req)
|
||||
}
|
||||
}
|
||||
|
||||
const JOSE_JSON: &str = "application/jose+json";
|
||||
const REPLAY_NONCE: &str = "Replay-Nonce";
|
||||
|
|
Loading…
Reference in New Issue