aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/application/default_middleware_stack.rb
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2016-12-31 08:20:35 +1030
committerMatthew Draper <matthew@trebex.net>2016-12-31 08:40:01 +1030
commit6b126ffdcd8031bfe83fc311a230799c05e2c955 (patch)
treeb1ddc4ce35782de91aa12d360536aee9d58671f0 /railties/lib/rails/application/default_middleware_stack.rb
parent2c5190e3299c83a357c8bf8010d6ca7bff99c1b5 (diff)
downloadrails-6b126ffdcd8031bfe83fc311a230799c05e2c955.tar.gz
rails-6b126ffdcd8031bfe83fc311a230799c05e2c955.tar.bz2
rails-6b126ffdcd8031bfe83fc311a230799c05e2c955.zip
Enforce middleware ordering with a test, instead of comments
We want the actual order to be very predictable, so it's rightly defined in code -- not with an on-the-fly tsort. But we can do the tsort here, and then verify that it matches the implemented ordering. This way we don't leave future readers guessing which parts of the ordering are deliberate and which are arbitrary.
Diffstat (limited to 'railties/lib/rails/application/default_middleware_stack.rb')
-rw-r--r--railties/lib/rails/application/default_middleware_stack.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/railties/lib/rails/application/default_middleware_stack.rb b/railties/lib/rails/application/default_middleware_stack.rb
index 5ecc7bb7c6..d070aca2dd 100644
--- a/railties/lib/rails/application/default_middleware_stack.rb
+++ b/railties/lib/rails/application/default_middleware_stack.rb
@@ -41,10 +41,8 @@ module Rails
middleware.use ::Rack::Runtime
middleware.use ::Rack::MethodOverride unless config.api_only
middleware.use ::ActionDispatch::RequestId
-
middleware.use ::ActionDispatch::RemoteIp, config.action_dispatch.ip_spoofing_check, config.action_dispatch.trusted_proxies
- # Must come after Rack::MethodOverride to properly log overridden methods
- # Must come after ActionDispatch::RemoteIP to properly log ip address
+
middleware.use ::Rails::Rack::Logger, config.log_tags
middleware.use ::ActionDispatch::ShowExceptions, show_exceptions_app
middleware.use ::ActionDispatch::DebugExceptions, app, config.debug_exception_response_format