1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

call default_middleware_stack before merging stacks

`default_middleware_stack` seems to kick off the `on_load` calls that
may mutate the middleware stack.  We have to call that method before
merging middleware stacks, otherwise the middleware stacks get mutated
*after* the app middleware stack is built.
This commit is contained in:
Aaron Patterson 2015-09-29 14:36:32 -07:00
parent 42070f892b
commit ea3908535a

View file

@ -508,7 +508,8 @@ module Rails
def app
@app || @app_build_lock.synchronize {
@app ||= begin
config.middleware = build_middleware.merge_into(default_middleware_stack)
stack = default_middleware_stack
config.middleware = build_middleware.merge_into(stack)
config.middleware.build(endpoint)
end
}