From ae36fcedce1ffcf4f3331b444ea1779987c6615a Mon Sep 17 00:00:00 2001 From: Eugene Pimenov Date: Thu, 5 Feb 2009 07:33:34 +0300 Subject: Ruby 1.9 compat: call bytesize for content_length [#1881 state:committed] Signed-off-by: Jeremy Kemper --- actionpack/lib/action_controller/response.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_controller') diff --git a/actionpack/lib/action_controller/response.rb b/actionpack/lib/action_controller/response.rb index 27860a6207..2daeeb9202 100644 --- a/actionpack/lib/action_controller/response.rb +++ b/actionpack/lib/action_controller/response.rb @@ -236,7 +236,7 @@ module ActionController # :nodoc: elsif length = headers['Content-Length'] headers['Content-Length'] = length.to_s elsif !body.respond_to?(:call) && (!status || status.to_s[0..2] != '304') - headers["Content-Length"] = body.size.to_s + headers["Content-Length"] = (body.respond_to?(:bytesize) ? body.bytesize : body.size).to_s end end -- cgit v1.2.3