From fd27137662282cd65a8fa05cdb013bb1723e367a Mon Sep 17 00:00:00 2001 From: Florian Staudacher Date: Wed, 19 Sep 2012 12:52:33 +0200 Subject: [PATCH] rack expects an array instead of a string, fixes #3499 --- lib/rack/chrome_frame.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/rack/chrome_frame.rb b/lib/rack/chrome_frame.rb index 1875bcb1f..81f438d6d 100644 --- a/lib/rack/chrome_frame.rb +++ b/lib/rack/chrome_frame.rb @@ -17,7 +17,7 @@ module Rack status, headers, response = @app.call(env) new_body = insert_tag(build_response_body(response)) new_headers = recalculate_body_length(headers, new_body) - return [status, new_headers, new_body] + return [status, new_headers, [new_body]] elsif @options[:minimum].nil? or ie_version(env['HTTP_USER_AGENT']) < @options[:minimum] html = <<-HTML @@ -42,6 +42,10 @@ module Rack def build_response_body(response) response_body = "" response.each { |part| response_body += part } + + # see: http://johnbintz.github.com/blog/2012/03/05/closing-given-body-in-rack-middleware/ + response.close if response.respond_to?(:close) + response_body end