diff options
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/response.rb | 2 |
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 |