From c7ba911a43e513bd1adbee93f16d2b8efea7cc88 Mon Sep 17 00:00:00 2001 From: Yehuda Katz + Carl Lerche Date: Tue, 25 Aug 2009 12:14:31 -0700 Subject: ActionController::Metal can be a middleware --- actionpack/lib/action_dispatch/http/response.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_dispatch/http') diff --git a/actionpack/lib/action_dispatch/http/response.rb b/actionpack/lib/action_dispatch/http/response.rb index 055f29a972..e457450059 100644 --- a/actionpack/lib/action_dispatch/http/response.rb +++ b/actionpack/lib/action_dispatch/http/response.rb @@ -161,13 +161,16 @@ module ActionDispatch # :nodoc: headers[CONTENT_TYPE] = type end - def prepare! + def to_a assign_default_content_type_and_charset! handle_conditional_get! self["Set-Cookie"] = @cookie.join("\n") self["ETag"] = @etag if @etag + super end + alias prepare! to_a + def each(&callback) if @body.respond_to?(:call) @writer = lambda { |x| callback.call(x) } -- cgit v1.2.3