aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/request_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-05-28 00:10:13 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-05-28 00:10:13 +0000
commite5b3d4b3b53178fda008fc8638f52a526e717984 (patch)
tree067ad94f1026ceb90b4c8814c39a874eecc7d412 /actionpack/test/controller/request_test.rb
parent0aed1d629e82de743416a60461d52dace24bd4c4 (diff)
downloadrails-e5b3d4b3b53178fda008fc8638f52a526e717984.tar.gz
rails-e5b3d4b3b53178fda008fc8638f52a526e717984.tar.bz2
rails-e5b3d4b3b53178fda008fc8638f52a526e717984.zip
request.remote_ip understands X-Forwarded-For addresses with nonstandard whitespace. Closes #7386.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6877 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller/request_test.rb')
-rw-r--r--actionpack/test/controller/request_test.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/actionpack/test/controller/request_test.rb b/actionpack/test/controller/request_test.rb
index 1e6f6db8d8..e14036fd2f 100644
--- a/actionpack/test/controller/request_test.rb
+++ b/actionpack/test/controller/request_test.rb
@@ -29,6 +29,9 @@ class RequestTest < Test::Unit::TestCase
@request.env['HTTP_X_FORWARDED_FOR'] = '10.0.0.1,3.4.5.6'
assert_equal '3.4.5.6', @request.remote_ip
+
+ @request.env['HTTP_X_FORWARDED_FOR'] = '10.0.0.1, 10.0.0.1, 3.4.5.6'
+ assert_equal '3.4.5.6', @request.remote_ip
@request.env['HTTP_X_FORWARDED_FOR'] = '127.0.0.1,3.4.5.6'
assert_equal '127.0.0.1', @request.remote_ip