From ec5d374768ced6aba3fed8a9481d2ac3c07cdb98 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 1 Jul 2009 13:49:29 -0700 Subject: tee_input: avoid ignoring initial body blob This was causing the first part of the body to be missing when an HTTP client failed to delay between sending the header and body in the request. --- lib/unicorn/tee_input.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/unicorn/tee_input.rb b/lib/unicorn/tee_input.rb index 3d19d7e..8dd8954 100644 --- a/lib/unicorn/tee_input.rb +++ b/lib/unicorn/tee_input.rb @@ -21,7 +21,10 @@ module Unicorn @tmp.binmode @tmp.sync = true - @tmp.write(body) if body + if body + @tmp.write(body) + @tmp.seek(0) + end @input = input @size = size # nil if chunked end -- cgit v1.2.3-24-ge0c7