diff options
author | Leonid Batizhevsky <l.batizhevsky@fun-box.ru> | 2015-04-09 21:05:49 +0400 |
---|---|---|
committer | Keenan Brock <keenan@thebrocks.net> | 2016-12-30 15:57:32 -0500 |
commit | 6efdb7177bcafe5034d210759446deec1feb6880 (patch) | |
tree | 67f816d9db026b23247f09f067481a50c3d6716f /railties | |
parent | 8ebd34b249fbcc392d058e18538aeca1f2fb5293 (diff) | |
download | rails-6efdb7177bcafe5034d210759446deec1feb6880.tar.gz rails-6efdb7177bcafe5034d210759446deec1feb6880.tar.bz2 rails-6efdb7177bcafe5034d210759446deec1feb6880.zip |
Allow log remote ip addres when config.action_dispatch.trusted_proxies passed
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/application/default_middleware_stack.rb | 3 | ||||
-rw-r--r-- | railties/test/application/middleware_test.rb | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/railties/lib/rails/application/default_middleware_stack.rb b/railties/lib/rails/application/default_middleware_stack.rb index 14c0a8cbe4..5ecc7bb7c6 100644 --- a/railties/lib/rails/application/default_middleware_stack.rb +++ b/railties/lib/rails/application/default_middleware_stack.rb @@ -42,11 +42,12 @@ module Rails 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 - middleware.use ::ActionDispatch::RemoteIp, config.action_dispatch.ip_spoofing_check, config.action_dispatch.trusted_proxies unless config.cache_classes middleware.use ::ActionDispatch::Reloader, app.reloader diff --git a/railties/test/application/middleware_test.rb b/railties/test/application/middleware_test.rb index be41dcb299..5cbd457111 100644 --- a/railties/test/application/middleware_test.rb +++ b/railties/test/application/middleware_test.rb @@ -30,10 +30,10 @@ module ApplicationTests "Rack::Runtime", "Rack::MethodOverride", "ActionDispatch::RequestId", + "ActionDispatch::RemoteIp", # Must come before Rails::Rack::Logger to properly log request_id "Rails::Rack::Logger", # must come after Rack::MethodOverride to properly log overridden methods "ActionDispatch::ShowExceptions", "ActionDispatch::DebugExceptions", - "ActionDispatch::RemoteIp", "ActionDispatch::Reloader", "ActionDispatch::Callbacks", "ActiveRecord::Migration::CheckPending", |