aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/http/request.rb
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2011-11-16 12:53:43 -1000
committerAndre Arko <andre@arko.net>2011-11-16 12:53:43 -1000
commitf05ccf805a6d2a3ed73ef9928577e8b0ebbb3c49 (patch)
tree040ee91d28a54d035ef611acbd23ff7cfdfd96b0 /actionpack/lib/action_dispatch/http/request.rb
parentcef1e14e09e5654895f264a2cff1c0898672b1f0 (diff)
downloadrails-f05ccf805a6d2a3ed73ef9928577e8b0ebbb3c49.tar.gz
rails-f05ccf805a6d2a3ed73ef9928577e8b0ebbb3c49.tar.bz2
rails-f05ccf805a6d2a3ed73ef9928577e8b0ebbb3c49.zip
Revert "Revert "Merge pull request #3640 from indirect/remote_ip""
This reverts commit 8d1a2b3ecde5a8745b3eaab4763a71d80ca3441f, because I have fixed the issues this commit caused in the next commit.
Diffstat (limited to 'actionpack/lib/action_dispatch/http/request.rb')
-rw-r--r--actionpack/lib/action_dispatch/http/request.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb
index b10f6b48c7..0e8bd0bd6d 100644
--- a/actionpack/lib/action_dispatch/http/request.rb
+++ b/actionpack/lib/action_dispatch/http/request.rb
@@ -155,10 +155,9 @@ module ActionDispatch
@ip ||= super
end
- # Originating IP address, usually set by the RemoteIp middleware.
+ # Originating IP address from the RemoteIp middleware.
def remote_ip
- # Coerce the remote_ip object into a string, because to_s could return nil
- @remote_ip ||= @env["action_dispatch.remote_ip"].to_s || ip
+ @remote_ip ||= @env["action_dispatch.remote_ip"]
end
# Returns the unique request id, which is based off either the X-Request-Id header that can