lib/bullet.rb in bullet-7.0.5 vs lib/bullet.rb in bullet-7.0.6

- old
+ new

@@ -21,10 +21,10 @@ autoload :NotificationCollector, 'bullet/notification_collector' if defined?(Rails::Railtie) class BulletRailtie < Rails::Railtie initializer 'bullet.configure_rails_initialization' do |app| - if defined?(ActionDispatch::ContentSecurityPolicy::Middleware) + if defined?(ActionDispatch::ContentSecurityPolicy::Middleware) && app.middleware.include?(ActionDispatch::ContentSecurityPolicy::Middleware) app.middleware.insert_before ActionDispatch::ContentSecurityPolicy::Middleware, Bullet::Rack else app.middleware.use Bullet::Rack end end