nickel-org / nickel.rs

An expressjs inspired web framework for Rust

Home Page:http://nickel-org.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Finalizer" middleware

pnathan opened this issue · comments

I am working through a relatively full featured backend api server, which includes in the middleware stack, among other things, things like:

  • api keys
  • logging

let's walk through the problem:

the api keys middleware will check validity of the api key- if good, it calls next_middleware(), if not good, it calls send(), without calling next_middleware.

But, I also have a logging middleware that should track both the incoming URL and the outgoing status code.
now, as per spect, next_middleware ends the middleware call tree, but, I need this finalizer code (logging) to execute.

thoughts?