aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/application/configuration.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/application/configuration.rb')
-rw-r--r--railties/lib/rails/application/configuration.rb18
1 files changed, 11 insertions, 7 deletions
diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb
index 9353fbefef..1b8af370f7 100644
--- a/railties/lib/rails/application/configuration.rb
+++ b/railties/lib/rails/application/configuration.rb
@@ -1,4 +1,5 @@
require 'active_support/deprecation'
+require 'active_support/core_ext/string/encoding'
require 'rails/engine/configuration'
module Rails
@@ -10,7 +11,8 @@ module Rails
:encoding, :consider_all_requests_local, :dependency_loading,
:filter_parameters, :log_level, :logger, :metals,
:plugins, :preload_frameworks, :reload_engines, :reload_plugins,
- :secret_token, :serve_static_assets, :time_zone, :whiny_nils
+ :secret_token, :serve_static_assets, :session_options,
+ :time_zone, :whiny_nils
def initialize(*)
super
@@ -27,8 +29,15 @@ module Rails
def encoding=(value)
@encoding = value
- if defined?(Encoding) && Encoding.respond_to?(:default_external=)
+ if "ruby".encoding_aware?
Encoding.default_external = value
+ Encoding.default_internal = value
+ else
+ $KCODE = value
+ if $KCODE == "NONE"
+ raise "The value you specified for config.encoding is " \
+ "invalid. The possible values are UTF8, SJIS, or EUC"
+ end
end
end
@@ -130,11 +139,6 @@ module Rails
end
end
- def session_options
- return @session_options unless @session_store == :cookie_store
- @session_options.merge(:secret => @secret_token)
- end
-
protected
def default_middleware_stack