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, | ||||
| }; | ||||
| use futures_util::{ | ||||
|     future::{LocalBoxFuture, TryFutureExt}, | ||||
|     future::TryFutureExt, | ||||
|     stream::{once, TryStreamExt}, | ||||
| }; | ||||
| use std::{ | ||||
|  | @ -45,7 +45,7 @@ where | |||
| { | ||||
|     type Response = S::Response; | ||||
|     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>> { | ||||
|         self.1.poll_ready(cx) | ||||
|  | @ -68,13 +68,9 @@ where | |||
|                 )), | ||||
|             }); | ||||
| 
 | ||||
|             let fut = self.1.call(req); | ||||
| 
 | ||||
|             Box::pin(async move { fut.await }) | ||||
|             self.1.call(req) | ||||
|         } else { | ||||
|             let fut = self.1.call(req); | ||||
| 
 | ||||
|             Box::pin(async move { fut.await }) | ||||
|             self.1.call(req) | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue