mirror of
https://github.com/ntex-rs/ntex.git
synced 2025-04-03 04:47:39 +03:00
fix
This commit is contained in:
parent
52cb7d4219
commit
4824b31b3c
1 changed files with 4 additions and 7 deletions
|
@ -356,14 +356,11 @@ where
|
|||
}
|
||||
|
||||
fn call(&self, req: &'a mut WebRequest<'a, Err>) -> Self::Future {
|
||||
let r1 = unsafe { (req as *mut WebRequest<'a, Err>).as_mut().unwrap() };
|
||||
let r2 = unsafe { (req as *mut WebRequest<'a, Err>).as_mut().unwrap() };
|
||||
|
||||
let fut = self.filter.call(r1);
|
||||
let fut = self.filter.call(req);
|
||||
let router = self.router.clone();
|
||||
|
||||
Box::pin(async move {
|
||||
let _ = fut.await.unwrap();
|
||||
let req = fut.await.unwrap();
|
||||
|
||||
let res = router.router.recognize_checked(req, |req, guards| {
|
||||
if let Some(guards) = guards {
|
||||
|
@ -377,9 +374,9 @@ where
|
|||
});
|
||||
|
||||
if let Some((srv, _info)) = res {
|
||||
srv.call(r2).await
|
||||
srv.call(req).await
|
||||
} else if let Some(ref default) = router.default {
|
||||
default.call(r2).await
|
||||
default.call(req).await
|
||||
} else {
|
||||
Ok(WebResponse::new(Response::NotFound().finish()))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue