<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -36,7 +36,10 @@ class Rack::ESI
 
     xml.search(&quot;esi:comment&quot;).remove
 
-    [status, headers, [xml.to_s]]
+    processed_body = xml.to_s
+    processed_headers = headers.merge(&quot;Content-Length&quot; =&gt; processed_body.size.to_s)
+
+    [status, processed_headers, [processed_body]]
   end
 
   private</diff>
      <filename>lib/rack/esi.rb</filename>
    </modified>
    <modified>
      <diff>@@ -76,6 +76,16 @@ class TestRackESI &lt; Test::Unit::TestCase
     assert_equal(expected_body, actual_body)
   end
 
+  def test_setting_of_content_length
+    mock_app = const([200, {&quot;Content-Type&quot; =&gt; &quot;text/html&quot;}, [&quot;Osameli. &lt;esi:comment text='*'/&gt;&quot;]])
+
+    esi_app = Rack::ESI.new(mock_app)
+
+    response = esi_app.call(&quot;SCRIPT_NAME&quot; =&gt; &quot;&quot;, &quot;PATH_INFO&quot; =&gt; &quot;/&quot;)
+
+    assert_equal(&quot;9&quot;, response[1][&quot;Content-Length&quot;])
+  end
+
   private
 
   def const(value)</diff>
      <filename>test/test_rack_esi.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>0acfe4d745accee28ec5c9f767907abfbeb65169</id>
    </parent>
  </parents>
  <author>
    <name>Christoffer Sawicki</name>
    <email>christoffer.sawicki@gmail.com</email>
  </author>
  <url>http://github.com/Qerub/rack-esi/commit/1616c3463e7165541109cdf3bc89d6a3925f1d3f</url>
  <id>1616c3463e7165541109cdf3bc89d6a3925f1d3f</id>
  <committed-date>2009-02-21T18:26:48-08:00</committed-date>
  <authored-date>2009-02-21T18:23:20-08:00</authored-date>
  <message>Add Content-Length to processed responses</message>
  <tree>6b01866ace000fa728bab91e038172714da2a66c</tree>
  <committer>
    <name>Christoffer Sawicki</name>
    <email>christoffer.sawicki@gmail.com</email>
  </committer>
</commit>
