diff --git a/lib/font_assets/railtie.rb b/lib/font_assets/railtie.rb index fbd507b..20e2887 100644 --- a/lib/font_assets/railtie.rb +++ b/lib/font_assets/railtie.rb @@ -8,7 +8,8 @@ class Railtie < Rails::Railtie config.font_assets.origin ||= "*" config.font_assets.options ||= { allow_ssl: true } - insert_target = if defined?(ActionDispatch::Static) + middleware_operations = app.middleware.instance_variable_get(:@operations) + insert_target = if defined?(ActionDispatch::Static) && middleware_operations.flatten.map(&:to_s).include?('ActionDispatch::Static') ActionDispatch::Static else Rack::Runtime