aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/middleware/remote_ip.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2017-03-22 00:51:29 -0700
committerGitHub <noreply@github.com>2017-03-22 00:51:29 -0700
commit34fe2a4fc778d18b7fe6bdf3629c1481bee789b9 (patch)
treea32f89a9b2db8272a788d63eb41a94964fa18204 /actionpack/lib/action_dispatch/middleware/remote_ip.rb
parentafbbcf24d791362a65c7f29b739c73a5b09e3816 (diff)
parent1c6747999a74eac84d4e30d698f59c16e0309d64 (diff)
downloadrails-34fe2a4fc778d18b7fe6bdf3629c1481bee789b9.tar.gz
rails-34fe2a4fc778d18b7fe6bdf3629c1481bee789b9.tar.bz2
rails-34fe2a4fc778d18b7fe6bdf3629c1481bee789b9.zip
Merge pull request #28394 from shime/docs-action-dispatch
[docs] fix ActionDispatch documentation
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware/remote_ip.rb')
-rw-r--r--actionpack/lib/action_dispatch/middleware/remote_ip.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/remote_ip.rb b/actionpack/lib/action_dispatch/middleware/remote_ip.rb
index 8bae5bfeff..53d5a4918c 100644
--- a/actionpack/lib/action_dispatch/middleware/remote_ip.rb
+++ b/actionpack/lib/action_dispatch/middleware/remote_ip.rb
@@ -157,13 +157,13 @@ module ActionDispatch
def ips_from(header) # :doc:
return [] unless header
- # Split the comma-separated list into an array of strings
+ # Split the comma-separated list into an array of strings.
ips = header.strip.split(/[,\s]+/)
ips.select do |ip|
begin
- # Only return IPs that are valid according to the IPAddr#new method
+ # Only return IPs that are valid according to the IPAddr#new method.
range = IPAddr.new(ip).to_range
- # we want to make sure nobody is sneaking a netmask in
+ # We want to make sure nobody is sneaking a netmask in.
range.begin == range.end
rescue ArgumentError
nil