A stack-based HTTP middleware