Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make sure that we set `env["action_dispatch.show_exceptions"]`

This has been used by `show_exception` middleware even the setting wasn't get passed to `env` hash.

(This is the backported version to 3-0-stable)
  • Loading branch information...
commit 69c0badec5c974b97cbde689a840de94867dc665 1 parent 77d4211
@sikachu sikachu authored tenderlove committed
View
3  railties/lib/rails/application.rb
@@ -171,7 +171,8 @@ def call(env)
def env_defaults
@env_defaults ||= {
"action_dispatch.parameter_filter" => config.filter_parameters,
- "action_dispatch.secret_token" => config.secret_token
+ "action_dispatch.secret_token" => config.secret_token,
+ "action_dispatch.show_exceptions" => config.action_dispatch.show_exceptions
}
end
View
15 railties/test/application/configuration_test.rb
@@ -277,5 +277,20 @@ def index
get "/"
assert_not_equal res, last_response.body
end
+
+ test "config.action_dispatch.show_exceptions is sent in env" do
+ make_basic_app do |app|
+ app.config.action_dispatch.show_exceptions = true
+ end
+
+ class ::OmgController < ActionController::Base
+ def index
+ render :text => env["action_dispatch.show_exceptions"]
+ end
+ end
+
+ get "/"
+ assert_equal 'true', last_response.body
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.