Permalink
Browse files

Fixed that proxy IPs do not follow all RFC1918 nets #251 [caleb@aei-t…

…ech.com]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@789 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 4fbc3e3 commit 11404e17e3cb0ad6a80066d2219ce3db50af9b38 @dhh dhh committed Feb 24, 2005
Showing with 3 additions and 1 deletion.
  1. +2 −0 actionpack/CHANGELOG
  2. +1 −1 actionpack/lib/action_controller/request.rb
@@ -1,5 +1,7 @@
*SVN*
+* Fixed that proxy IPs do not follow all RFC1918 nets #251 [caleb@aei-tech.com]
+
* Added Base#render_to_string to parse a template and get the result back as a string #479
* Fixed that send_file/data can work even if render* has been called before in action processing to render the content of a file to be send for example #601
@@ -43,7 +43,7 @@ def remote_ip
if env.include? 'HTTP_X_FORWARDED_FOR' then
remote_ips = env['HTTP_X_FORWARDED_FOR'].split(',').reject do |ip|
- ip =~ /^unknown$|^(10|172\.16|192\.168)\./i
+ ip =~ /^unknown$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\./i
end
return remote_ips.first.strip unless remote_ips.empty?

0 comments on commit 11404e1

Please sign in to comment.