forked from mirrors/relay
Improve debug middleware
This commit is contained in:
parent
ed0ea6521e
commit
1a638f7f8d
1 changed files with 4 additions and 8 deletions
|
@ -5,7 +5,7 @@ use actix_web::{
|
||||||
HttpMessage,
|
HttpMessage,
|
||||||
};
|
};
|
||||||
use futures_util::{
|
use futures_util::{
|
||||||
future::{LocalBoxFuture, TryFutureExt},
|
future::TryFutureExt,
|
||||||
stream::{once, TryStreamExt},
|
stream::{once, TryStreamExt},
|
||||||
};
|
};
|
||||||
use std::{
|
use std::{
|
||||||
|
@ -45,7 +45,7 @@ where
|
||||||
{
|
{
|
||||||
type Response = S::Response;
|
type Response = S::Response;
|
||||||
type Error = S::Error;
|
type Error = S::Error;
|
||||||
type Future = LocalBoxFuture<'static, Result<S::Response, S::Error>>;
|
type Future = S::Future;
|
||||||
|
|
||||||
fn poll_ready(&self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
|
fn poll_ready(&self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
|
||||||
self.1.poll_ready(cx)
|
self.1.poll_ready(cx)
|
||||||
|
@ -68,13 +68,9 @@ where
|
||||||
)),
|
)),
|
||||||
});
|
});
|
||||||
|
|
||||||
let fut = self.1.call(req);
|
self.1.call(req)
|
||||||
|
|
||||||
Box::pin(async move { fut.await })
|
|
||||||
} else {
|
} else {
|
||||||
let fut = self.1.call(req);
|
self.1.call(req)
|
||||||
|
|
||||||
Box::pin(async move { fut.await })
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue