aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/railtie.rb
blob: 30b3535e17e1a60b9b2c516dcf205f793f3c3a33 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require "action_dispatch"
require "rails"

module ActionDispatch
  class Railtie < Rails::Railtie
    railtie_name :action_dispatch

    config.action_dispatch.x_sendfile_header = "X-Sendfile"
    config.action_dispatch.ip_spoofing_check = true
    config.action_dispatch.session = {}
    config.action_dispatch.session_store = :cookie_store

    # Prepare dispatcher callbacks and run 'prepare' callbacks
    initializer "action_dispatch.prepare_dispatcher" do |app|
      # TODO: This used to say unless defined?(Dispatcher). Find out why and fix.
      require 'rails/dispatcher'
      ActionDispatch::Callbacks.to_prepare { app.routes_reloader.reload_if_changed }
    end
  end
end