lib/bbk/app/dispatcher.rb in bbk-app-1.0.0.79514 vs lib/bbk/app/dispatcher.rb in bbk-app-1.0.0.80957
- old
+ new
@@ -158,10 +158,10 @@
[matched, callback.is_a?(BBK::App::Factory) ? callback.create : callback]
end
def build_processing_stack
stack = proc{|msg| process_message(msg) }
- middlewares.reduce(stack) do |stack, middleware|
+ middlewares.reverse.reduce(stack) do |stack, middleware|
if middleware.respond_to?(:build)
middleware.build(stack)
else
middleware.new(stack)
end