2010-01-17 06:41:55 -05:00
|
|
|
require "action_dispatch"
|
|
|
|
|
|
|
|
module ActionDispatch
|
|
|
|
class Railtie < Rails::Railtie
|
2010-03-26 13:47:55 -04:00
|
|
|
config.action_dispatch = ActiveSupport::OrderedOptions.new
|
2011-08-07 11:34:49 -04:00
|
|
|
config.action_dispatch.x_sendfile_header = nil
|
2010-03-03 19:22:30 -05:00
|
|
|
config.action_dispatch.ip_spoofing_check = true
|
2010-04-02 14:00:29 -04:00
|
|
|
config.action_dispatch.show_exceptions = true
|
2010-07-27 22:24:56 -04:00
|
|
|
config.action_dispatch.best_standards_support = true
|
2010-07-27 10:39:28 -04:00
|
|
|
config.action_dispatch.tld_length = 1
|
2011-05-02 17:38:39 -04:00
|
|
|
config.action_dispatch.ignore_accept_header = false
|
2011-12-01 13:16:19 -05:00
|
|
|
config.action_dispatch.rescue_templates = { }
|
|
|
|
config.action_dispatch.rescue_responses = { }
|
2012-01-17 05:56:50 -05:00
|
|
|
config.action_dispatch.default_charset = nil
|
2011-12-01 13:16:19 -05:00
|
|
|
|
|
|
|
config.action_dispatch.rack_cache = {
|
|
|
|
:metastore => "rails:/",
|
|
|
|
:entitystore => "rails:/",
|
2012-03-02 21:15:06 -05:00
|
|
|
:verbose => false
|
2011-12-01 13:16:19 -05:00
|
|
|
}
|
|
|
|
|
2010-07-27 10:39:28 -04:00
|
|
|
initializer "action_dispatch.configure" do |app|
|
|
|
|
ActionDispatch::Http::URL.tld_length = app.config.action_dispatch.tld_length
|
2011-05-02 17:38:39 -04:00
|
|
|
ActionDispatch::Request.ignore_accept_header = app.config.action_dispatch.ignore_accept_header
|
2012-01-17 05:56:50 -05:00
|
|
|
ActionDispatch::Response.default_charset = app.config.action_dispatch.default_charset || app.config.encoding
|
2011-11-23 15:36:56 -05:00
|
|
|
|
2011-12-01 14:02:00 -05:00
|
|
|
ActionDispatch::ExceptionWrapper.rescue_responses.merge!(config.action_dispatch.rescue_responses)
|
|
|
|
ActionDispatch::ExceptionWrapper.rescue_templates.merge!(config.action_dispatch.rescue_templates)
|
2011-12-01 13:16:19 -05:00
|
|
|
|
2011-11-23 15:36:56 -05:00
|
|
|
config.action_dispatch.always_write_cookie = Rails.env.development? if config.action_dispatch.always_write_cookie.nil?
|
|
|
|
ActionDispatch::Cookies::CookieJar.always_write_cookie = config.action_dispatch.always_write_cookie
|
2011-12-23 11:56:49 -05:00
|
|
|
|
|
|
|
ActionDispatch.test_app = app
|
2010-07-27 10:39:28 -04:00
|
|
|
end
|
2010-01-17 06:41:55 -05:00
|
|
|
end
|
2010-07-27 22:24:56 -04:00
|
|
|
end
|