diff options
author | Atul Bhosale <atul1bhosale@gmail.com> | 2018-07-31 20:09:42 +0530 |
---|---|---|
committer | Atul Bhosale <atul1bhosale@gmail.com> | 2018-07-31 20:45:37 +0530 |
commit | 7e40e9585a5596558d71f76c61bb35316cb17a53 (patch) | |
tree | 5a61c36e1527cd1c2c519fc1c2dfe3dcb7ed5120 /railties/test/application/rack/logger_test.rb | |
parent | 0f5497499cee78c52b14485d102c602884fb20cb (diff) | |
download | rails-7e40e9585a5596558d71f76c61bb35316cb17a53.tar.gz rails-7e40e9585a5596558d71f76c61bb35316cb17a53.tar.bz2 rails-7e40e9585a5596558d71f76c61bb35316cb17a53.zip |
Log the remote IP addr of clients behind a proxy
[Atul Bhosale, Victor Nawothnig]
Diffstat (limited to 'railties/test/application/rack/logger_test.rb')
-rw-r--r-- | railties/test/application/rack/logger_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/railties/test/application/rack/logger_test.rb b/railties/test/application/rack/logger_test.rb index d949a48366..ea425d5fa5 100644 --- a/railties/test/application/rack/logger_test.rb +++ b/railties/test/application/rack/logger_test.rb @@ -53,6 +53,12 @@ module ApplicationTests wait assert_match 'Started HEAD "/"', logs end + + test "logger logs correct remote IP address" do + get "/", {}, { "REMOTE_ADDR" => "127.0.0.1", "HTTP_X_FORWARDED_FOR" => "1.2.3.4" } + wait + assert_match 'Started GET "/" for 1.2.3.4', logs + end end end end |