diff options
author | Caleb Spare <cespare@gmail.com> | 2013-10-25 14:16:42 -0700 |
---|---|---|
committer | Caleb Spare <cespare@gmail.com> | 2013-10-26 12:28:44 -0700 |
commit | cd78d725263b24ba33c1a5ec7b82f9576419f5d1 (patch) | |
tree | 87f9c2c3260bca24822f34a302d40d7e25e3b6a3 /actionpack/lib/action_dispatch/middleware | |
parent | 52199d1fd41ffc439357c16a7873fb04444175cd (diff) | |
download | rails-cd78d725263b24ba33c1a5ec7b82f9576419f5d1.tar.gz rails-cd78d725263b24ba33c1a5ec7b82f9576419f5d1.tar.bz2 rails-cd78d725263b24ba33c1a5ec7b82f9576419f5d1.zip |
Make remote_ip detection properly handle private IPv6 addresses
Fixes #12638.
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/remote_ip.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/remote_ip.rb b/actionpack/lib/action_dispatch/middleware/remote_ip.rb index 57bc6d5cd0..f676e4c598 100644 --- a/actionpack/lib/action_dispatch/middleware/remote_ip.rb +++ b/actionpack/lib/action_dispatch/middleware/remote_ip.rb @@ -31,7 +31,7 @@ module ActionDispatch TRUSTED_PROXIES = %r{ ^127\.0\.0\.1$ | # localhost IPv4 ^::1$ | # localhost IPv6 - ^fc00: | # private IPv6 range fc00 + ^[fF][cCdD] | # private IPv6 range fc00::/7 ^10\. | # private IPv4 range 10.x.x.x ^172\.(1[6-9]|2[0-9]|3[0-1])\.| # private IPv4 range 172.16.0.0 .. 172.31.255.255 ^192\.168\. # private IPv4 range 192.168.x.x |