1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-29 00:07:48 +02:00

add middleware finished handler for route middleware

This commit is contained in:
Nikolay Kim
2018-04-29 20:50:38 -07:00
parent 91235ac816
commit ab4e889f96
3 changed files with 90 additions and 16 deletions

View File

@@ -187,6 +187,9 @@ impl<S: 'static> ResourceHandler<S> {
///
/// This is similar to `App's` middlewares, but
/// middlewares get invoked on resource level.
///
/// *Note* `Middleware::finish()` fires right after response get
/// prepared. It does not wait until body get sent to peer.
pub fn middleware<M: Middleware<S>>(&mut self, mw: M) {
Rc::get_mut(&mut self.middlewares)
.unwrap()