Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix status initialization when custom status provided

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
  • Loading branch information...
commit a75d21df06d0b7af21921aad38b021056aa15e63 1 parent 608bf7b
@krekoten krekoten authored spastorino committed
View
4 actionpack/lib/action_dispatch/http/response.rb
@@ -44,8 +44,8 @@ def initialize(status = 200, header = {}, body = [])
@block = nil
@length = 0
- @status, @header = status, header
- self.body = body
+ @header = header
+ self.body, self.status = body, status
@cookie = []
@sending_file = false
View
4 actionpack/test/dispatch/response_test.rb
@@ -18,6 +18,10 @@ def setup
body.each { |part| parts << part }
assert_equal ["Hello, World!"], parts
end
+
+ test "status handled properly in initialize" do
+ assert_equal 200, ActionDispatch::Response.new('200 OK').status
+ end
test "utf8 output" do
@response.body = [1090, 1077, 1089, 1090].pack("U*")
Please sign in to comment.
Something went wrong with that request. Please try again.