lib/mini_profiler_rails/railtie.rb in rack-mini-profiler-0.10.1 vs lib/mini_profiler_rails/railtie.rb in rack-mini-profiler-0.10.2

- old
+ new

@@ -26,14 +26,10 @@ if serves_static_assets?(app) c.skip_paths << app.config.assets.prefix end - if Rails.env.development? - c.skip_schema_queries = true - end - unless Rails.env.development? || Rails.env.test? c.authorization_mode = :whitelist end if Rails.logger @@ -84,9 +80,20 @@ class Railtie < ::Rails::Railtie initializer "rack_mini_profiler.configure_rails_initialization" do |app| Rack::MiniProfilerRails.initialize!(app) + end + + # Suppress compression when Rack::Deflater is lower in the middleware + # stack than Rack::MiniProfiler + config.after_initialize do |app| + middlewares = app.middleware.middlewares + if Rack::MiniProfiler.config.suppress_encoding.nil? && + middlewares.include?(Rack::Deflater) && + middlewares.index(Rack::Deflater) > middlewares.index(Rack::MiniProfiler) + Rack::MiniProfiler.config.suppress_encoding = true + end end # TODO: Implement something better here # config.after_initialize do #