提交 2e88b5d3 编写于 作者: R Rick Olson

Fixed the failsafe response so it uses either the current recognized...

Fixed the failsafe response so it uses either the current recognized controller or ApplicationController.  [Rick Olson]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4629 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 99e9faed
*SVN*
* Fixed the failsafe response so it uses either the current recognized controller or ApplicationController. [Rick Olson]
* Make sure script/reaper only reaps dispatcher pids by default, and not the spawner's pid. [Jamis Buck]
* Fix script/plugin about so it uses about.yml and not meta.yml. [James Adam]
......
......@@ -32,14 +32,17 @@ class << self
# own CGI object be sure to handle the exceptions it raises on multipart
# requests (EOFError and ArgumentError).
def dispatch(cgi = nil, session_options = ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS, output = $stdout)
controller = nil
if cgi ||= new_cgi(output)
request, response = ActionController::CgiRequest.new(cgi, session_options), ActionController::CgiResponse.new(cgi)
prepare_application
ActionController::Routing::Routes.recognize(request).process(request, response).out(output)
controller = ActionController::Routing::Routes.recognize(request)
controller.process(request, response).out(output)
end
rescue Object => exception
failsafe_response(output, '500 Internal Server Error', exception) do
ActionController.process_with_exception(request, response, exception).out(output)
controller ||= const_defined?(:ApplicationController) ? ApplicationController : ActionController::Base
controller.process_with_exception(request, response, exception).out(output)
end
ensure
# Do not give a failsafe response here.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册