aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-12-05 02:30:21 -0800
committerJosé Valim <jose.valim@gmail.com>2011-12-05 02:30:21 -0800
commit446bdb449d47d5608a98b297d4f76c783e996b34 (patch)
tree53dc3974e031bb77f5e5bb05f84a82e0acd16478 /actionpack/test/controller
parentcf6ccf0ebd632ae5a8d4fc3b30ba47eff9837eef (diff)
parente31c4ace97638d186aae389dd2cbe3b5786beb57 (diff)
downloadrails-446bdb449d47d5608a98b297d4f76c783e996b34.tar.gz
rails-446bdb449d47d5608a98b297d4f76c783e996b34.tar.bz2
rails-446bdb449d47d5608a98b297d4f76c783e996b34.zip
Merge pull request #3857 from Overbryd/redirect_to_url_with_network_path_reference
Fix for redirect_to to respect urls with a network path reference like "//asset.host.com/resources/1235"
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/redirect_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/controller/redirect_test.rb b/actionpack/test/controller/redirect_test.rb
index 79041055bd..5b739e49ac 100644
--- a/actionpack/test/controller/redirect_test.rb
+++ b/actionpack/test/controller/redirect_test.rb
@@ -70,6 +70,10 @@ class RedirectController < ActionController::Base
redirect_to "x-test+scheme.complex:redirect"
end
+ def redirect_to_url_with_network_path_reference
+ redirect_to "//www.rubyonrails.org/"
+ end
+
def redirect_to_back
redirect_to :back
end
@@ -216,6 +220,12 @@ class RedirectTest < ActionController::TestCase
assert_equal "x-test+scheme.complex:redirect", redirect_to_url
end
+ def test_redirect_to_url_with_network_path_reference
+ get :redirect_to_url_with_network_path_reference
+ assert_response :redirect
+ assert_equal "//www.rubyonrails.org/", redirect_to_url
+ end
+
def test_redirect_to_back
@request.env["HTTP_REFERER"] = "http://www.example.com/coming/from"
get :redirect_to_back