diff options
author | Pat Allan <pat@freelancing-gods.com> | 2012-02-13 21:37:07 +1300 |
---|---|---|
committer | Andrew White <andyw@pixeltrix.co.uk> | 2012-02-23 13:25:13 +0000 |
commit | ab838900f8a5fac4ad251257a77ae0edf7543942 (patch) | |
tree | f7c3a8f3fd3832806b253faa6b9c8c57032a4de5 /actionpack | |
parent | ed988eece022ae314428d153792aaa26e8749b47 (diff) | |
download | rails-ab838900f8a5fac4ad251257a77ae0edf7543942.tar.gz rails-ab838900f8a5fac4ad251257a77ae0edf7543942.tar.bz2 rails-ab838900f8a5fac4ad251257a77ae0edf7543942.zip |
SSL should not be disabled by default in any environment.
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_controller/metal/force_ssl.rb | 2 | ||||
-rw-r--r-- | actionpack/test/controller/force_ssl_test.rb | 14 |
2 files changed, 1 insertions, 15 deletions
diff --git a/actionpack/lib/action_controller/metal/force_ssl.rb b/actionpack/lib/action_controller/metal/force_ssl.rb index 69e37d8713..17918b8ec7 100644 --- a/actionpack/lib/action_controller/metal/force_ssl.rb +++ b/actionpack/lib/action_controller/metal/force_ssl.rb @@ -26,7 +26,7 @@ module ActionController def force_ssl(options = {}) host = options.delete(:host) before_filter(options) do - if !request.ssl? && !Rails.env.development? + unless request.ssl? redirect_options = {:protocol => 'https://', :status => :moved_permanently} redirect_options.merge!(:host => host) if host redirect_options.merge!(:params => request.query_parameters) diff --git a/actionpack/test/controller/force_ssl_test.rb b/actionpack/test/controller/force_ssl_test.rb index b681a19fe0..7feeda25b3 100644 --- a/actionpack/test/controller/force_ssl_test.rb +++ b/actionpack/test/controller/force_ssl_test.rb @@ -109,20 +109,6 @@ class ForceSSLExceptActionTest < ActionController::TestCase end end -class ForceSSLExcludeDevelopmentTest < ActionController::TestCase - tests ForceSSLControllerLevel - - def setup - Rails.env.stubs(:development?).returns(false) - end - - def test_development_environment_not_redirects_to_https - Rails.env.stubs(:development?).returns(true) - get :banana - assert_response 200 - end -end - class ForceSSLFlashTest < ActionController::TestCase tests ForceSSLFlash |