From b4e56c6868125af8e5c773140da0775a831779d2 Mon Sep 17 00:00:00 2001 From: Stormwind Date: Fri, 23 Nov 2012 17:59:33 +0100 Subject: Sets Content-Length to body string length It joins the body array to a string and sets the Content-Length header to its length. --- lib/zero/response.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/zero/response.rb b/lib/zero/response.rb index cfd1148..2886a0d 100644 --- a/lib/zero/response.rb +++ b/lib/zero/response.rb @@ -42,7 +42,7 @@ module Zero # Also creates one, if it does not exists # def content_length - header['Content-Length'] = 0 + header['Content-Length'] = body.join.length end end -- cgit v1.2.3-70-g09d2