aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorEugene Pimenov <libc@mac.com>2009-02-05 07:33:34 +0300
committerJeremy Kemper <jeremy@bitsweat.net>2009-02-06 10:28:09 -0800
commitae36fcedce1ffcf4f3331b444ea1779987c6615a (patch)
treeaf334b3e2df229d4e59acdfdb537be3fb01ec11b /actionpack/lib
parent55812291952382fd29be57a9806c151f43cf1c43 (diff)
downloadrails-ae36fcedce1ffcf4f3331b444ea1779987c6615a.tar.gz
rails-ae36fcedce1ffcf4f3331b444ea1779987c6615a.tar.bz2
rails-ae36fcedce1ffcf4f3331b444ea1779987c6615a.zip
Ruby 1.9 compat: call bytesize for content_length
[#1881 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/response.rb2
1 files changed, 1 insertions, 1 deletions
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