#
# Enforce SSL connections, if configured
if Errbit::Config.enforce_ssl
  Errbit::Application.configure do
    config.middleware.use Rack::SslEnforcer, :except => /^\/deploys/
  end
end

# Enforce SSL connections, if configured
if Errbit::Config.enforce_ssl
  ActionMailer::Base.default_url_options.merge!(:protocol => 'https://')
  Errbit::Application.configure do
    config.middleware.use Rack::SslEnforcer, :except => /^\/deploys/
  end
end

Set protocol https if enforce SSL connections configured
Set protocol https if enforce SSL connections configured
