Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

make sure set_response! sets the correct response object

  • Loading branch information...
commit 619e7c8db8b2339eae8f1f51eb2c1173808039cd 1 parent 08b107e
@tenderlove tenderlove authored
View
9 actionpack/lib/action_controller/metal/live.rb
@@ -111,5 +111,14 @@ def process(name)
@_response.await_commit
end
+
+ def set_response!(request)
+ if request.env["HTTP_VERSION"] == "HTTP/1.0"
+ super
+ else
+ @_response = Live::Response.new
+ @_response.request = request
+ end
+ end
end
end
View
6 actionpack/test/controller/live_stream_test.rb
@@ -53,6 +53,12 @@ def build_response
TestResponse.new
end
+ def test_set_response!
+ @controller.set_response!(@request)
+ assert_kind_of(Live::Response, @controller.response)
+ assert_equal @request, @controller.response.request
+ end
+
def test_write_to_stream
@controller = TestController.new
get :basic_stream
Please sign in to comment.
Something went wrong with that request. Please try again.