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:
parent
42070f892b
commit
ea3908535a
1 changed files with 2 additions and 1 deletions
|
@ -508,7 +508,8 @@ module Rails
|
||||||
def app
|
def app
|
||||||
@app || @app_build_lock.synchronize {
|
@app || @app_build_lock.synchronize {
|
||||||
@app ||= begin
|
@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)
|
config.middleware.build(endpoint)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue