diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-11-30 17:06:11 -0800 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-11-30 17:06:11 -0800 |
commit | 4fabc9b2f376c47d4381572167956063b3c8c418 (patch) | |
tree | e460c32a38c89081b51d960b3989a042f77a075d | |
parent | 93456a2ed275575a03bd2d6234095395dee6a655 (diff) | |
download | rails-4fabc9b2f376c47d4381572167956063b3c8c418.tar.gz rails-4fabc9b2f376c47d4381572167956063b3c8c418.tar.bz2 rails-4fabc9b2f376c47d4381572167956063b3c8c418.zip |
Simplify REMOTE_ADDR parsing
-rwxr-xr-x | actionpack/lib/action_controller/request.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/request.rb b/actionpack/lib/action_controller/request.rb index c079895683..78a57acf6f 100755 --- a/actionpack/lib/action_controller/request.rb +++ b/actionpack/lib/action_controller/request.rb @@ -209,7 +209,7 @@ module ActionController # delimited list in the case of multiple chained proxies; the last # address which is not trusted is the originating IP. def remote_ip - remote_addr_list = @env['REMOTE_ADDR'] && @env['REMOTE_ADDR'].split(',').collect(&:strip) + remote_addr_list = @env['REMOTE_ADDR'] && @env['REMOTE_ADDR'].scan(/[^,\s]+/) unless remote_addr_list.blank? not_trusted_addrs = remote_addr_list.reject {|addr| addr =~ TRUSTED_PROXIES} |