Skip to content

Commit

Permalink
Merge pull request rails-api#12 from webficient/master
Browse files Browse the repository at this point in the history
Fixed issue related to force_ssl = true when using Rails 3.2.3
  • Loading branch information
spastorino committed May 2, 2012
2 parents 55f27d2 + 6b0904b commit b741329
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/rails-api/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def default_middleware_stack
end

if config.force_ssl
middleware.use ::ActionDispatch::SSL, config.ssl_options
middleware.use ssl_module, config.ssl_options
end

if config.action_dispatch.x_sendfile_header.present?
Expand Down Expand Up @@ -64,6 +64,15 @@ def add_resource_route

private

def ssl_module
if defined? ::ActionDispatch::SSL
::ActionDispatch::SSL
else
require 'rack/ssl'
::Rack::SSL
end
end

def setup_generators!
generators = config.generators

Expand Down

0 comments on commit b741329

Please sign in to comment.