diff options
-rw-r--r-- | actionpack/lib/action_controller/metal/live.rb | 9 | ||||
-rw-r--r-- | actionpack/lib/action_controller/test_case.rb | 7 |
2 files changed, 8 insertions, 8 deletions
diff --git a/actionpack/lib/action_controller/metal/live.rb b/actionpack/lib/action_controller/metal/live.rb index 7db8d13e24..27b3eb4e58 100644 --- a/actionpack/lib/action_controller/metal/live.rb +++ b/actionpack/lib/action_controller/metal/live.rb @@ -36,8 +36,9 @@ module ActionController extend ActiveSupport::Concern module ClassMethods - def make_response!(request) - if request.env["HTTP_VERSION"] == "HTTP/1.0" + def make_response!(response) + request = response.request + if request.get_header("HTTP_VERSION") == "HTTP/1.0" super else Live::Response.new.tap do |res| @@ -293,8 +294,8 @@ module ActionController response.close if response end - def set_response!(request) - @_response = self.class.make_response! request + def set_response!(response) + @_response = self.class.make_response! response end end end diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index 2cada1f68a..698719377c 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -509,15 +509,14 @@ module ActionController end end - @controller.request = @request - @controller.response = @response - @request.fetch_header("SCRIPT_NAME") do |k| @request.set_header k, @controller.config.relative_url_root end @controller.recycle! - @controller.process(action) + @controller.dispatch(action, @request, @response) + @request = @controller.request + @response = @controller.response @request.delete_header 'HTTP_COOKIE' |