diff --git a/actionpack/lib/action_controller/rack_process.rb b/actionpack/lib/action_controller/rack_process.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_controller/rack_process.rb
+++ b/actionpack/lib/action_controller/rack_process.rb
@@ -189,6 +189,8 @@ end_msg
       if @body.respond_to?(:call)
         @writer = lambda { |x| callback.call(x) }
         @body.call(self, self)
+      elsif @body.is_a?(String)
+        @body.each_line(&callback)
       else
         @body.each(&callback)
       end
Don't use deprecated String#each