aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/base/responder.rb21
-rw-r--r--actionpack/lib/action_controller/testing/process.rb1
2 files changed, 12 insertions, 10 deletions
diff --git a/actionpack/lib/action_controller/base/responder.rb b/actionpack/lib/action_controller/base/responder.rb
index 989f82444b..1aee980da6 100644
--- a/actionpack/lib/action_controller/base/responder.rb
+++ b/actionpack/lib/action_controller/base/responder.rb
@@ -5,18 +5,19 @@ module ActionController
end
private
- def render_for_text(text = nil, append_response = false) #:nodoc:
+ def render_for_text(text) #:nodoc:
@performed_render = true
- if append_response
- response.body ||= ''
- response.body << text.to_s
- else
- response.body = case text
- when Proc then text
- when nil then " " # Safari doesn't pass the headers of the return if the response is zero length
- else text.to_s
+ case text
+ when Proc
+ response.body = text
+ when nil
+ # Safari 2 doesn't pass response headers if the response is zero-length
+ if response.body_parts.empty?
+ response.body_parts << ' '
end
+ else
+ response.body_parts << text
end
end
@@ -39,4 +40,4 @@ module ActionController
end
end
end
-end \ No newline at end of file
+end
diff --git a/actionpack/lib/action_controller/testing/process.rb b/actionpack/lib/action_controller/testing/process.rb
index 86e193efa9..7e2857614c 100644
--- a/actionpack/lib/action_controller/testing/process.rb
+++ b/actionpack/lib/action_controller/testing/process.rb
@@ -287,6 +287,7 @@ module ActionController #:nodoc:
include TestResponseBehavior
def recycle!
+ body_parts.clear
headers.delete('ETag')
headers.delete('Last-Modified')
end