Permalink
Browse files

We need to check explictly that env['action_dispatch.show_exceptions']

is false.

If it is nil we can't raise the exception
  • Loading branch information...
1 parent 8fe1dfd commit 84d38f6033a0eca73feb0eb8c43d99913b0204cb @rafaelfranca rafaelfranca committed Dec 26, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/lib/action_dispatch/middleware/debug_exceptions.rb
@@ -23,7 +23,7 @@ def call(env)
raise ActionController::RoutingError, "No route matches [#{env['REQUEST_METHOD']}] #{env['PATH_INFO'].inspect}"
end
rescue Exception => exception
- raise exception unless env['action_dispatch.show_exceptions']
+ raise exception if env['action_dispatch.show_exceptions'] == false
end
exception ? render_exception(env, exception) : response

2 comments on commit 84d38f6

Contributor

brynary replied Dec 26, 2012

@rafaelfranca - When would it be nil? If this behavior is important, can a test be written for it?

In the case of nil, the old behavior raised, and the new behavior renders the exception. Rendering exception data can potentially create security issues, so we should be careful about interpreting ambiguous values in the less-secure way.

Owner

rafaelfranca replied Dec 26, 2012

@brynary there are tests for this behavior, I reverted because they failed.

Also it was the behavior before the change here 61b91c4...8fe1dfd

Please sign in to comment.