lib/sentry/rails/railtie.rb in sentry-rails-4.1.7 vs lib/sentry/rails/railtie.rb in sentry-rails-4.2.0

- old
+ new

@@ -20,10 +20,11 @@ config.after_initialize do |app| next unless Sentry.initialized? configure_project_root configure_sentry_logger + configure_trusted_proxies extend_controller_methods extend_active_job if defined?(ActiveJob) override_streaming_reporter override_file_handler if app.config.public_file_server.enabled setup_backtrace_cleanup_callback @@ -35,9 +36,13 @@ Sentry.configuration.project_root = ::Rails.root.to_s end def configure_sentry_logger Sentry.configuration.logger = ::Rails.logger + end + + def configure_trusted_proxies + Sentry.configuration.trusted_proxies += Array(::Rails.application.config.action_dispatch.trusted_proxies) end def extend_active_job require "sentry/rails/active_job" ActiveJob::Base.send(:prepend, Sentry::Rails::ActiveJobExtensions)