aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorRyan McGeary <ryan@mcgeary.org>2012-02-06 17:47:17 -0500
committerRyan McGeary <ryan@mcgeary.org>2012-02-07 13:28:29 -0500
commit6efb849b32f672d9c26f36d2c823b134f49bd892 (patch)
treea770cda85563ba9c693b54f503f8235c57c6e35d /actionpack/lib
parent275c3a1cb3d0f38d1a28b1a8d6145a4d7e379acc (diff)
downloadrails-6efb849b32f672d9c26f36d2c823b134f49bd892.tar.gz
rails-6efb849b32f672d9c26f36d2c823b134f49bd892.tar.bz2
rails-6efb849b32f672d9c26f36d2c823b134f49bd892.zip
Fixed force_ssl redirects to include original query params
`ActionController.force_ssl` redirects http URLs to their https equivalent; however, when a URL contains a query string, the resulting redirect lacked the original query string. Conflicts: actionpack/lib/action_controller/metal/force_ssl.rb
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/metal/force_ssl.rb1
-rw-r--r--actionpack/lib/action_dispatch/routing/route_set.rb1
2 files changed, 2 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/metal/force_ssl.rb b/actionpack/lib/action_controller/metal/force_ssl.rb
index b45f211e83..69e37d8713 100644
--- a/actionpack/lib/action_controller/metal/force_ssl.rb
+++ b/actionpack/lib/action_controller/metal/force_ssl.rb
@@ -29,6 +29,7 @@ module ActionController
if !request.ssl? && !Rails.env.development?
redirect_options = {:protocol => 'https://', :status => :moved_permanently}
redirect_options.merge!(:host => host) if host
+ redirect_options.merge!(:params => request.query_parameters)
flash.keep
redirect_to redirect_options
end
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb
index c96999d23f..8e3975e369 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -567,6 +567,7 @@ module ActionDispatch
path_addition, params = generate(path_options, path_segments || {})
path << path_addition
+ params.merge!(options[:params] || {})
ActionDispatch::Http::URL.url_for(options.merge!({
:path => path,