lib/grape/app.rb in grape-app-0.8.6 vs lib/grape/app.rb in grape-app-0.8.7
- old
+ new
@@ -70,10 +70,15 @@
def middleware
config = self.config
@middleware ||= Rack::Builder.new do
use Rack::Cors, &config.cors if config.cors
- use Rack::SslEnforcer if config.force_ssl
+
+ if config.force_ssl.is_a?(Hash)
+ use Rack::SslEnforcer, **config.force_ssl
+ elsif config.force_ssl
+ use Rack::SslEnforcer
+ end
config.middleware.each do |block|
instance_eval(&block)
end
run Grape::App