From d743954792ccf5975a11ee88cdd690e8f1915728 Mon Sep 17 00:00:00 2001 From: Andre Arko Date: Mon, 14 Nov 2011 16:43:21 -1000 Subject: GetIp#to_s should never return nil. That's icky. --- actionpack/lib/action_dispatch/http/request.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'actionpack/lib/action_dispatch/http') 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 -- cgit v1.2.3