diff options
Diffstat (limited to 'lib/rack/content_length.rb')
-rw-r--r-- | lib/rack/content_length.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/rack/content_length.rb b/lib/rack/content_length.rb index 6a3711e2..cbac93ab 100644 --- a/lib/rack/content_length.rb +++ b/lib/rack/content_length.rb @@ -17,18 +17,18 @@ module Rack end def call(env) - status, headers, body = @app.call(env) + status, headers, body = response = @app.call(env) if !STATUS_WITH_NO_ENTITY_BODY.key?(status.to_i) && !headers[CONTENT_LENGTH] && !headers[TRANSFER_ENCODING] && body.respond_to?(:to_ary) - body = body.to_ary + response[2] = body = body.to_ary headers[CONTENT_LENGTH] = body.sum(&:bytesize).to_s end - [status, headers, body] + response end end end |