提交 ab838900 编写于 作者: P Pat Allan 提交者: Andrew White

SSL should not be disabled by default in any environment.

上级 ed988eec
......@@ -26,7 +26,7 @@ module ClassMethods
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)
......
......@@ -109,20 +109,6 @@ def test_cheeseburger_redirects_to_https
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册